Bug 202019

Summary: Class not initialized, crash on destruction if setup not called [patch]
Product: [Applications] digikam Reporter: Michael G. Hansen <mike>
Component: Plugin-WebService-PiwigoAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles, frederic.coiffier
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 0.6.0

Description Michael G. Hansen 2009-07-30 19:14:12 UTC
Version:           0.5 (using KDE 4.2.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Plugin_GalleryExport::mpGallery is not initialized in the constructor, this leads to a crash on destruction because the destructor tries to `delete mpGallery`. The crash only appears if the plugin is loaded and Plugin_GalleryExport::setup is not called (for example, because the application is not using this particular plugin).

Simple patch below.

Index: galleryexport/plugin_galleryexport.cpp
===================================================================
--- galleryexport/plugin_galleryexport.cpp      (revision 1004632)
+++ galleryexport/plugin_galleryexport.cpp      (working copy)
@@ -52,7 +52,7 @@
 K_EXPORT_PLUGIN(Factory("kipiplugin_galleryexport"))

 Plugin_GalleryExport::Plugin_GalleryExport(QObject *parent, const QVariantList&)
-                    : KIPI::Plugin(Factory::componentData(), parent, "GalleryExport")
+                    : KIPI::Plugin(Factory::componentData(), parent, "GalleryExport"), m_action(0), mpGallery(0)
 {
     kDebug(51001) << "Plugin_GalleryExport plugin loaded"
                   << endl;
Comment 1 caulier.gilles 2009-07-30 19:25:45 UTC
SVN commit 1004656 by cgilles:

init private members in constructor
BUGS: 202019


 M  +3 -2      plugin_galleryexport.cpp  
 M  +1 -1      plugin_galleryexport.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1004656