IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6740


Ignore:
Timestamp:
Mar 30, 2006, 1:46:51 PM (20 years ago)
Author:
Paul Price
Message:

Squashing memory leak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6737 r6740  
    169169    }
    170170    psMetadataAddStr(fpa->concepts, PS_LIST_HEAD, "FPA.NAME", PS_META_REPLACE, "Name of FPA", newFPAname);
     171    psFree(newFPAname);                 // Drop reference
    171172
    172173    // Where does the PHU go?
     
    372373
    373374                // Put in the extension
    374                 if (chip->hdu && chip->hdu != hdu) {
    375                     psLogMsg(__func__, PS_LOG_WARN, "Overwriting HDU in chip %s\n", chipName);
    376                     psFree(chip->hdu);  // Make way!
    377                 }
    378                 chip->hdu = psMemIncrRefCounter(hdu);
     375                if (chip->hdu) {
     376                    if (chip->hdu != hdu) {
     377                        psLogMsg(__func__, PS_LOG_WARN, "Overwriting HDU in chip %s\n", chipName);
     378                        psFree(chip->hdu);  // Make way!
     379                    }
     380                } else {
     381                    chip->hdu = psMemIncrRefCounter(hdu);
     382                }
    379383
    380384                // Put in the cell data
     
    434438                // Put in the extension
    435439                if (cell->hdu) {
    436                     psLogMsg(__func__, PS_LOG_WARN, "Overwriting HDU in chip %s, cell %s\n", chipName,
    437                              cellName);
    438                     psFree(cell->hdu);
    439                 }
    440                 cell->hdu = psMemIncrRefCounter(hdu);
     440                    if (cell->hdu != hdu) {
     441                        psLogMsg(__func__, PS_LOG_WARN, "Overwriting HDU in chip %s, cell %s\n", chipName,
     442                                 cellName);
     443                        psFree(cell->hdu);
     444                    }
     445                } else {
     446                    cell->hdu = psMemIncrRefCounter(hdu);
     447                }
    441448
    442449                // Put in the cell data
Note: See TracChangeset for help on using the changeset viewer.