IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41524


Ignore:
Timestamp:
Apr 2, 2021, 2:46:34 PM (5 years ago)
Author:
eugene
Message:

plug leaks from dropped toTPA, fromTPA transforms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPACopy.c

    r35561 r41524  
    504504
    505505    // Update the astrometric parameters
    506     target->toFPA = psMemIncrRefCounter (source->toFPA);
    507     target->fromFPA = psMemIncrRefCounter (source->fromFPA);
     506    // free any previous versions
     507    psFree (target->toFPA);   target->toFPA   = psMemIncrRefCounter (source->toFPA);
     508    psFree (target->fromFPA); target->fromFPA = psMemIncrRefCounter (source->fromFPA);
    508509
    509510    // Update the parent fpa astrometry parameters, or check that they match
    510511    pmFPA *targetFPA = target->parent;
    511512    pmFPA *sourceFPA = source->parent;
     513
    512514    // XXX should we require that both of these exist?
    513 
    514515    if (targetFPA && sourceFPA) {
    515         if (targetFPA->toSky) {
    516             psFree(targetFPA->toSky);
    517         }
    518         targetFPA->toSky = psMemIncrRefCounter (sourceFPA->toSky);
    519         if (targetFPA->toTPA) {
    520             psFree(targetFPA->toTPA);
    521         }
    522         targetFPA->toTPA = psMemIncrRefCounter (sourceFPA->toTPA);
    523         if (targetFPA->fromTPA) {
    524             psFree(targetFPA->fromTPA);
    525         }
    526         targetFPA->fromTPA = psMemIncrRefCounter (sourceFPA->fromTPA);
     516        psFree(targetFPA->toSky);   targetFPA->toSky = psMemIncrRefCounter (sourceFPA->toSky);
     517        psFree(targetFPA->toTPA);   targetFPA->toTPA = psMemIncrRefCounter (sourceFPA->toTPA);
     518        psFree(targetFPA->fromTPA); targetFPA->fromTPA = psMemIncrRefCounter (sourceFPA->fromTPA);
    527519    }
    528520
Note: See TracChangeset for help on using the changeset viewer.