IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6319


Ignore:
Timestamp:
Feb 3, 2006, 8:48:32 AM (20 years ago)
Author:
eugene
Message:

added missing frees

Location:
trunk/psphot/src
Files:
3 edited

Legend:

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

    r5993 r6319  
    11# include "psphot.h"
    22
     3// 2006.02.02 : no leaks? (creates source->blend entries)
     4// XXX if I free sources, I still have 54 leaks?
    35bool psphotBasicDeblend (psArray *sources, psMetadata *config, psStats *sky) {
    46
     
    109111                }
    110112            } 
     113            psFree (contour);
    111114        }
    112115    }
     
    116119    if (!strcasecmp (breakPt, "DEBLEND")) exit (0);
    117120
     121    psFree (SN);
     122    psFree (index);
     123    psFree (overlap);
     124   
    118125    return true;
    119126}
  • trunk/psphot/src/psphotImageBackground.c

    r6311 r6319  
    11# include "psphot.h"
    22
     3// 2006.02.02 : no leaks
    34psPolynomial2D *psphotImageBackground (pmReadout *readout, psMetadata *config, psStats *sky)
    45{
     
    6162    sky->sampleMean = 0.0;
    6263
     64    psFree (x);
     65    psFree (y);
     66    psFree (z);
     67    psFree (rnd);  // XXX should this be made available at a higher level?
     68
    6369    psLogMsg ("psphot", 3, "fit background model: %f sec\n", psTimerMark ("psphot"));
    6470    return (skyModel);
  • trunk/psphot/src/psphotReadout.c

    r6311 r6319  
    11# include "psphot.h"
     2
     3# define MEM_0 psMemId ID = psMemGetId ();
     4# define MEM_1(A) \
     5    psTimerStop ();\
     6    if (A != NULL) { psFree (A); } \
     7    fprintf (stderr, "found %d leaks\n", psMemCheckLeaks (ID, NULL, NULL, false));\
     8    exit (1);
    29
    310bool psphotReadout (pmReadout *readout, psMetadata *config) {
     
    815    psStats     *sky     = NULL;
    916    bool         status;
     17    psPolynomial2D *model = NULL;
    1018
    1119    psphotSaveImage (NULL, readout->mask, "mask.fits");
     
    1826    // generate a background model (currently, 2D polynomial)
    1927    // XXX this should be available to be re-added to the original image
    20     psphotImageBackground (readout, config, sky);
     28    model = psphotImageBackground (readout, config, sky);
    2129
    2230    // find the peaks in the image
     
    3341
    3442    // use bright stellar objects to measure PSF
     43    MEM_0;
    3544    psf = psphotChoosePSF (config, sources, sky);
     45    MEM_1(psf);
    3646
    3747    // XXX change FITMODE to a string
Note: See TracChangeset for help on using the changeset viewer.