[Kstars-devel] KDE/kdeedu/kstars/kstars
Alexey Khudyakov
alexey.skladnoy at gmail.com
Tue Jul 28 18:17:20 CEST 2009
SVN commit 1003685 by khudyakov:
Make destructors for SkyObject and SkyComposite virtual.
Non-virtual destructors may lead to memory leak
Thanks to cppcheck
CCMAIL: kstars-devel at kde.org
M +2 -4 skycomponents/skycomposite.h
M +2 -4 skyobjects/skyobject.h
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skycomposite.h #1003684:1003685
@@ -52,10 +52,8 @@
SkyComposite( SkyComponent *parent );
SkyComposite( SkyComponent *parent, bool (*visibleMethod)());
- /**
- *@short Destructor
- */
- ~SkyComposite();
+ /** *@short Destructor */
+ virtual ~SkyComposite();
/**
*@short Delegate draw requests to all sub components
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skyobject.h #1003684:1003685
@@ -89,10 +89,8 @@
SkyObject( int t, double r, double d, float m=0.0,
const QString &n=QString(), const QString &n2=QString(), const QString &lname=QString() );
- /**
- *Destructor (empty)
- */
- ~SkyObject();
+ /** Destructor (empty) */
+ virtual ~SkyObject();
/** Create copy of object.
* This method is virtual copy constructor. It allows for safe
More information about the Kstars-devel
mailing list