Bug 202019 - Class not initialized, crash on destruction if setup not called [patch]
Summary: Class not initialized, crash on destruction if setup not called [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-WebService-Piwigo (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 19:14 UTC by Michael G. Hansen
Modified: 2023-02-25 09:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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