[Dcmlib] Re: ptotential memory leak without virtual destructor.

Dennis hudr at hotmail.com
Tue Nov 16 01:43:13 CET 2004


Hi, Matheieu,

>From my debugging and testing, i guess gdcm::Header creates TagHT.
 
But after i clean the TagHT, i can't delete PixelConvert, or else crash.
 
>From my debugging in gdcmFile.cxx, in the following codes:
 
 // Will be 7fe0, 0010 in standard case
   GetHeader()->SetEntryBinAreaByNumber( pixelData, 
      GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel()); 
 
this call bind the pixelData to the internalHeader and pixelData memory will
be managed by internalHeader, 
so we can't delete PixelConverter after internalHeader is cleaned. I think
it's some bizarre. why we do in this way?
now i have comment out delete PixelConvert because internalHeader have
cleaned the data.
 
Hope you can have a better solution for this issue.
 
Dennis. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20041115/71cf9032/attachment.html>


More information about the Dcmlib mailing list