Commits

Darrell Schiebel authored 79a3f6cf1e6 Merge
Merge pull request #951 in CASA/casa from CAS-12443 to master

* commit '406ea8f34042b7b59b4e422d7f18d637d7542881': unique_ptr to prevent leak in _stokesFromRecord/fromBCS, CAS-12443

code/imageanalysis/ImageAnalysis/ImageInputProcessor.cc

Modified
62 62 }
63 63
64 64 String ImageInputProcessor::_stokesFromRecord(
65 65 const Record& region, const CoordinateSystem& csys
66 66 ) const {
67 67 // FIXME This implementation is incorrect for complex, recursive records
68 68 String stokes = "";
69 69 if(csys.hasPolarizationCoordinate()) {
70 70 Int polAxis = csys.polarizationAxisNumber();
71 71 uInt stokesBegin, stokesEnd;
72 - ImageRegion *imreg = ImageRegion::fromRecord(region, "");
72 + std::unique_ptr<ImageRegion> imreg(ImageRegion::fromRecord(region, ""));
73 73 Array<Float> blc, trc;
74 74 Bool oneRelAccountedFor = false;
75 75 if (imreg->isLCSlicer()) {
76 76 blc = imreg->asLCSlicer().blc();
77 77 trc = imreg->asLCSlicer().trc();
78 78 stokesBegin = (uInt)((Vector<Float>)blc)[polAxis];
79 79 stokesEnd = (uInt)((Vector<Float>)trc)[polAxis];
80 80 oneRelAccountedFor = true;
81 81 }
82 82 else if (RegionManager::isPixelRegion(*(ImageRegion::fromRecord(region, "")))) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut