IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

plug a leak from dropped transformations; minor comment and whitespace changes; add applyPixelNaN lookup to config->arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoadAstrometry.c

    r39981 r41526  
    150150            }
    151151        }
    152         targetChip->toFPA = psMemIncrRefCounter (chip->toFPA);
    153         targetChip->fromFPA = psMemIncrRefCounter (chip->fromFPA);
     152        if (targetChip != chip) {
     153          psAssert (!targetChip->toFPA, "oops");
     154          psAssert (!targetChip->fromFPA, "oops");
     155          targetChip->toFPA = psMemIncrRefCounter (chip->toFPA);
     156          targetChip->fromFPA = psMemIncrRefCounter (chip->fromFPA);
     157        }
    154158    }
    155159
    156160    // for pswarpLocalFrame, I need transformations and HDUs on a single fpa (so set on astrom as well as target)
    157     target->fpa->toTPA = psMemIncrRefCounter (astrom->fpa->toTPA);
    158     target->fpa->fromTPA = psMemIncrRefCounter (astrom->fpa->fromTPA);
    159     target->fpa->toSky = psMemIncrRefCounter (astrom->fpa->toSky);
     161    // But: do not increment the ref counter if this is the same entry
     162    if (target->fpa != astrom->fpa) {
     163      psAssert (!target->fpa->toTPA, "oops");
     164      psAssert (!target->fpa->fromTPA, "oops");
     165      psAssert (!target->fpa->toSky, "oops");
     166      target->fpa->toTPA = psMemIncrRefCounter (astrom->fpa->toTPA);
     167      target->fpa->fromTPA = psMemIncrRefCounter (astrom->fpa->fromTPA);
     168      target->fpa->toSky = psMemIncrRefCounter (astrom->fpa->toSky);
     169    }
    160170
    161171    // reset the type to the original value
Note: See TracChangeset for help on using the changeset viewer.