IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2006, 8:52:03 PM (20 years ago)
Author:
eugene
Message:

extensive cleanup of memory handling : no more leaks!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotChoosePSF.c

    r6117 r6379  
    11# include "psphot.h"
    22
     3// 2006.02.07 : no leaks!
    34// try PSF models and select best option
    45pmPSF *psphotChoosePSF (psMetadata *config, psArray *sources, psStats *skystats) {
     
    89    pmPSFtry       *try   = NULL;
    910    psArray        *stars = NULL;
    10     psMetadataItem *item  = NULL;
    1111
    1212    psTimerStart ("psphot");
     
    3737    psMetadataItem *mdi = psMetadataLookup (config, "PSF_MODEL");
    3838    if (mdi == NULL) psAbort ("psphotChoosePSF", "missing PSF_MODEL selection");
     39
    3940    if (mdi->type == PS_DATA_STRING) {
    4041        list = psListAlloc(NULL);
     
    5152    psListIterator *iter = psListIteratorAlloc (list, PS_LIST_HEAD, FALSE);
    5253    for (int i = 0; i < models->n; i++) {
    53 
    54         item = psListGetAndIncrement (iter);
     54        // XXX psListGetAndIncrement does not increment ref counter!?
     55        // XXX if it did, i should free 'item' below
     56        psMetadataItem *item = psListGetAndIncrement (iter);
    5557        modelName = item->data.V;
    56 
    5758        models->data[i] = pmPSFtryModel (stars, modelName, RADIUS);
    58         psFree (modelName);
    59         psFree (item);
     59        // psFree (item);
    6060    }
    6161    psFree (iter);
     
    9898    psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
    9999
    100     char *breakPt = psMetadataLookupPtr (&status, config, "BREAK_POINT");
     100    char *breakPt = psMetadataLookupStr (&status, config, "BREAK_POINT");
    101101    if (!strcasecmp (breakPt, "PSFFIT")) exit (0);
    102102
Note: See TracChangeset for help on using the changeset viewer.