IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2006, 11:18:31 AM (20 years ago)
Author:
Paul Price
Message:

Squashing memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_p0/psModules/src/astrom/pmChipMosaic.c

    r6145 r6342  
    66#include "pmChipMosaic.h"
    77
    8 #define MEM_LEAKS 1
     8#define MEM_LEAKS 0
    99
    1010// Compare a value with a maximum and minimum
     
    156156            continue;
    157157        }
     158
     159        psMetadataPrint(cell->concepts, 10);
     160
    158161        nCells++;
    159162        gain       += psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN");
     
    266269
    267270        // The images to put into the mosaic
    268         images->data[i]  = readout->image;
    269         weights->data[i] = readout->weight;
    270         masks->data[i]   = readout->mask;
     271        images->data[i]  = psMemIncrRefCounter(readout->image);
     272        weights->data[i] = psMemIncrRefCounter(readout->weight);
     273        masks->data[i]   = psMemIncrRefCounter(readout->mask);
    271274    }
    272275    // Mosaic the images together and we're done
     
    311314
    312315    // Chop off all the component cells, and put in a new one
    313     #ifndef MEM_LEAKS
     316    #if !MEM_LEAKS
    314317    pmChipFreeCells(chip);
    315318    #else
     
    321324    cellConcepts(cell, cells, xBinChip, yBinChip);
    322325
    323     #if 1
     326    #if 0
    324327    // XXX For the sake of getting something working, I am not going to bother with sorting out where
    325328    // the double free is coming from.  I'm going to drop the pointers on the array and create a memory
    326329    // leak.  We can clean this up later, when we're not under as much pressure.
    327     #else
    328 
    329330    psArrayElementsFree(chip->cells);
    330331    chip->cells->n = 0;
     
    337338    // Want the readouts to contain a subimage, but that subimage is the whole image.
    338339    // This preserves the relationship there was before, where freeing the parent frees the child.
    339     readout->image = psMemIncrRefCounter(psImageSubset(image, entire));
    340     readout->weight = psMemIncrRefCounter(psImageSubset(weight, entire));
    341     readout->mask = psMemIncrRefCounter(psImageSubset(mask, entire));
     340    readout->image = psImageSubset(image, entire);
     341    readout->weight = psImageSubset(weight, entire);
     342    readout->mask = psImageSubset(mask, entire);
    342343    psFree(readout);
    343344
Note: See TracChangeset for help on using the changeset viewer.