IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 28, 2008, 10:40:04 AM (18 years ago)
Author:
Paul Price
Message:

Attempt to plug memory leak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsAverage.c

    r15975 r16710  
    1818    psMetadataItem *item = psMetadataLookup(MD, NAME); \
    1919    item->data.TYPE = VALUE; \
     20}
     21
     22// Update a metadata string entry directly
     23#define MD_UPDATE_STR(MD, NAME, VALUE) \
     24{ \
     25    psMetadataItem *item = psMetadataLookup(MD, NAME); \
     26    psFree(item->data.str); \
     27    item->data.str = psStringCopy(VALUE); \
    2028}
    2129
     
    6472
    6573    MD_UPDATE(target->concepts, "FPA.TIMESYS", S32, timeSys);
    66     // XXX: The following is causing a memory leak in the test code.  Not sur ehow to fix it.
    67     MD_UPDATE(target->concepts, "FPA.FILTER", str, psStringCopy(filter));
    68     //psMetadataRemoveKey(target->concepts, "FPA.TIMESYS");
    69     //psMetadataAddStr(target->concepts, PS_LIST_HEAD, "FPA.TIMESYS", PS_META_REPLACE, NULL, filter);
     74    MD_UPDATE_STR(target->concepts, "FPA.FILTER", filter);
    7075
    7176    // FPA.TIME needs special care
Note: See TracChangeset for help on using the changeset viewer.