[Dcmlib] ptotential memory leak without virtual destructor.

derong denis_hudr at sina.com
Sat Nov 13 03:27:09 CET 2004


Hi, Mathieu,
 
I have tried to use gdcm. but after i exit my MFC appliaction. There are
tons of memory leak about DICOM reading.
It's very difficult to track this bug because it's dynamic...
 
However, i found something is not correct with gdcm. the destructor of
gdcm::ElementSet is not vritual.(it's bad)
gdcm::Document is derived from gdcm::ElementSet. it's destructor is virtual.
the base class gdcm::DocEntry also has 
a  vritual destructor. This will bring unpredictable result as i read from
http://www.codersource.net/cpp_virtual_destructors.html
 
By the way, in the file gdcmutil.cxx. the function has called va_start, but
there is no va_end to set args to 0.
I think that it maybe a potential bug.
 
 
thx,
 
Dennis 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20041112/8c574374/attachment.html>


More information about the Dcmlib mailing list