IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2006, 3:33:07 PM (20 years ago)
Author:
Paul Price
Message:

Plugging memory leaks --- done.

File:
1 edited

Legend:

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

    r6734 r6743  
    307307    // Get the size of the HDU, either from existing trimsec and biassec, or generate these and try again
    308308    int xSize = 0, ySize = 0;           // Size of HDU
    309     #if 1
    310 
    311309    if (!sizeHDU(&xSize, &ySize, targetCells) && !(generateTrimBias(targetCells, sourceCells) &&
    312310            sizeHDU(&xSize, &ySize, targetCells))) {
     
    314312        return false;
    315313    }
    316     #else
    317     if (!sizeHDU(&xSize, &ySize, targetCells)) {
    318         if (generateTrimBias(targetCells, sourceCells)) {
    319             if (!sizeHDU(&xSize, &ySize, targetCells)) {
    320                 psError(PS_ERR_IO, true, "Unable to determine size of HDU!\n");
    321                 return false;
    322             }
    323         } else {
    324             psError(PS_ERR_IO, true, "Unable to determine size of HDU!\n");
    325             return false;
    326         }
    327     }
    328     #endif
     314    psFree(targetCells);
     315    psFree(sourceCells);
    329316
    330317    hdu->images = psArrayAlloc(numReadouts);
     
    509496        } else {
    510497            copyPixels(hdu->images->data[i], sourceImage, *trimsec, xFlip, yFlip);
    511             targetReadout->image = psMemIncrRefCounter(psImageSubset(hdu->images->data[i], *trimsec));
     498            targetReadout->image = psImageSubset(hdu->images->data[i], *trimsec);
    512499        }
    513500
     
    532519            } else {
    533520                copyPixels(hdu->images->data[i], bias, *biassec, xFlip, yFlip);
    534                 psImage *newBias = psMemIncrRefCounter(psImageSubset(hdu->images->data[i], *biassec));
     521                psImage *newBias = psImageSubset(hdu->images->data[i], *biassec);
    535522                psListAdd(targetReadout->bias, PS_LIST_TAIL, newBias);
    536523                psFree(newBias);        // Drop reference
    537524            }
    538525        }
     526        psFree(targetReadout);          // Drop reference
    539527        psFree(biassecsIter);
    540528        psFree(biasIter);
     
    551539        }
    552540    }
     541    psFree(conceptsIter);
    553542
    554543    // Need to update CELL.X0 and CELL.Y0 if we flipped
Note: See TracChangeset for help on using the changeset viewer.