IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2006, 1:02:02 PM (20 years ago)
Author:
Paul Price
Message:

Fixing memory leaks and multiple frees

File:
1 edited

Legend:

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

    r6351 r6386  
    288288    int nCells = cells->n;
    289289
    290     // Modify the "original" pixels
     290    // Fix up the HDU
    291291    if (chip->parent->hdu) {
    292292        psLogMsg(__func__, PS_LOG_WARN, "The original format has the entire FPA in a single extension.  "
     
    311311    }
    312312
    313     // Chop off all the component cells, and put in a new one
     313    // Chop off all the component cells, and construct a new one
    314314    pmCell *newCell = pmCellAlloc(NULL, NULL, __func__); // New cell
    315315    cellConcepts(newCell, cells, xBinChip, yBinChip);
     
    326326    // This preserves the relationship there was before, where freeing the parent frees the child.
    327327    psRegion entire = {0.0, 0.0, 0.0, 0.0};
    328     newReadout->image = psImageSubset(image, entire);
    329     newReadout->weight = psImageSubset(weight, entire);
    330     newReadout->mask = psImageSubset(mask, entire);
     328    newReadout->image = psMemIncrRefCounter(psImageSubset(image, entire));
     329    newReadout->weight = psMemIncrRefCounter(psImageSubset(weight, entire));
     330    newReadout->mask = psMemIncrRefCounter(psImageSubset(mask, entire));
    331331    // Drop references
    332332    psFree(newReadout);
Note: See TracChangeset for help on using the changeset viewer.