Ticket #739 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

python memory leak in makeMaskedImage

Reported by: dubcovsky Owned by: rhl
Priority: normal Milestone:
Component: afw Keywords:
Cc: dubcovsky Blocked By:
Blocking: Project: LSST
Version Number:
How to repeat:
import lsst.afw.image as afwImage
import lsst.daf.base as dafBase
memId0 = dafBase.Citizen_getNextMemId()
img = afwImage.ImageF((32, 32), 1)
var = afwImage.ImageF((32,32), 0)
msk = afwImage.MaskU((32, 32), 0)
mi0 = afwImage.makeMaskedImage(img, msk, var)
del var; del msk; del img;
del mi0
numCitizens = dafBase.Citizen_census(0, memId0)
if numCitizens != 0:
    print numCitizens, 'Objects Leaked:'
    print dafBase.Citizen_census(dafBase.cout, memId0)

Description

When working in python, using the lsst.afw.image.makeMaskedImage factory method results in memory leaks.

I believe this is due to some funkiness of swig.

Attachments

memTest.py (465 bytes) - added by dubcovsky 10 years ago.
Use this script to reproduce leak.

Change History

Changed 10 years ago by dubcovsky

Use this script to reproduce leak.

comment:1 Changed 10 years ago by dubcovsky

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [9065].

makeMaskedImage now returns a shared_ptr instead of a raw pointer. This makes swig happy.

Note: See TracTickets for help on using tickets.