SVN commit 488419 by cgilles:
Digikam from trunk : fix memory leak : KAboutData isn't cleaned automaticly by KDE lib. CCMAIL: [hidden email] M +15 -19 imageeffect_solarize.cpp M +4 -3 imageeffect_solarize.h --- trunk/extragear/graphics/digikamimageplugins/solarize/imageeffect_solarize.cpp #488418:488419 @@ -63,20 +63,20 @@ { // About data and help button. - KAboutData* about = new KAboutData("digikamimageplugins", - I18N_NOOP("Solarize a Photograph"), - digikamimageplugins_version, - I18N_NOOP("A solarize image plugin for digiKam."), - KAboutData::License_GPL, - "(c) 2004, Renchi Raju", - 0, - "http://extragear.kde.org/apps/digikamimageplugins"); + m_about = new KAboutData("digikamimageplugins", + I18N_NOOP("Solarize a Photograph"), + digikamimageplugins_version, + I18N_NOOP("A solarize image plugin for digiKam."), + KAboutData::License_GPL, + "(c) 2004, Renchi Raju", + 0, + "http://extragear.kde.org/apps/digikamimageplugins"); - about->addAuthor("Renchi Raju", I18N_NOOP("Author and maintainer"), - "[hidden email]"); + m_about->addAuthor("Renchi Raju", I18N_NOOP("Author and maintainer"), + "[hidden email]"); m_helpButton = actionButton( Help ); - KHelpMenu* helpMenu = new KHelpMenu(this, about, false); + KHelpMenu* helpMenu = new KHelpMenu(this, m_about, false); helpMenu->menu()->removeItemAt(0); helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, SLOT(slotHelp()), 0, -1, 0); m_helpButton->setPopup( helpMenu->menu() ); @@ -122,6 +122,10 @@ ImageEffect_Solarize::~ImageEffect_Solarize() { saveDialogSize("Solarize Tool Dialog"); + + delete m_about; + delete m_numInput; + delete m_previewWidget; } void ImageEffect_Solarize::slotHelp() @@ -129,14 +133,6 @@ KApplication::kApplication()->invokeHelp("solarizeimage", "digikamimageplugins"); } -void ImageEffect_Solarize::closeEvent(QCloseEvent *e) -{ - delete m_numInput; - delete m_previewWidget; - - e->accept(); -} - void ImageEffect_Solarize::slotEffect() { Digikam::ImageIface* iface = m_previewWidget->imageIface(); --- trunk/extragear/graphics/digikamimageplugins/solarize/imageeffect_solarize.h #488418:488419 @@ -35,6 +35,7 @@ class QPushButton; class KDoubleNumInput; +class KAboutData; namespace Digikam { @@ -57,8 +58,6 @@ void solarize(double factor, uchar *data, int w, int h, bool sb); - void closeEvent(QCloseEvent *e); - private: QWidget *m_parent; @@ -66,7 +65,9 @@ QPushButton *m_helpButton; KDoubleNumInput *m_numInput; - + + KAboutData *m_about; + Digikam::ImageWidget *m_previewWidget; private slots: _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |