Bug 289779 - Plugins are not really freed / unplugged when disabled in the setup dialog
Summary: Plugins are not really freed / unplugged when disabled in the setup dialog
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Plugins (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-25 13:53 UTC by Andi Clemens
Modified: 2019-02-10 13:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andi Clemens 2011-12-25 13:53:54 UTC
Version:           2.5.0 (using KDE 4.7.3) 
OS:                Linux

When I unplug a kipiplugin in digiKam, it shows different issues:

1. The icon is not shown anymore (can be fixed by adding an icon to the desktop files (currently doing this)
2. The setup dialog crashes for all plugins that have no icon defined in the desktop file, e.g. the calendar plugin. If you disable it and reenter the setup dialog, digiKam crashes.
This happens because the plugin is not really unloaded and holds references on the plugin actions, but these actions have been deleted, so accessing the action makes digiKam crash.
We have 3 signals in the PluginLoader, two of them are not used (plug / unplug) and one deprecated signal, which is used (replug). 
I will provide a fix for the crash and also for the missing icons, but maybe someone else should take a look at the code after my patch has been applied, because there was (at least) an attempt to use the signals plug / unplug, but it never did happen. 
We either remove those signals (and make "replug" non-deprecated) or another solution must be found.

I know this crash is reported from time to time and we always thought it was fixed, but it actually never was. So I reopen the issue by opening a new bug.

Reproducible: Didn't try

Steps to Reproduce:
See above

Actual Results:  
crashes, plugins are not unloaded

Expected Results:  
should not crash, plugins should be unloaded
Comment 1 Andi Clemens 2011-12-25 14:41:03 UTC
Git commit 7777a73cfdcba6d7b0686c71b529d04e78b18563 by Andi Clemens.
Committed on 25/12/2011 at 13:20.
Pushed by aclemens into branch 'master'.

Add icons to desktop files so that they are shown in the setup page when the plugin is disablesd.

This should also avoid the infamous pluginloader crash that occurs when a plugin is disabled and the setup dialog is entered again.
Related: bug 289779

M  +1    -1    acquireimages/kipiplugin_acquireimages.desktop
M  +1    -1    advancedslideshow/plugin/kipiplugin_advancedslideshow.desktop
M  +1    -1    batchprocessimages/plugin/kipiplugin_batchprocessimages.desktop
M  +1    -1    calendar/plugin/kipiplugin_calendar.desktop
M  +1    -1    debianscreenshots/kipiplugin_debianscreenshots.desktop
M  +1    -1    flickrexport/kipiplugin_flickrexport.desktop
M  +1    -1    galleryexport/kipiplugin_galleryexport.desktop
M  +1    -1    gpssync/kipiplugin_gpssync.desktop
M  +1    -1    htmlexport/kipiplugin_htmlexport.desktop
M  +1    -1    imageviewer/kipiplugin_imageviewer.desktop
M  +1    -1    ipodexport/kipiplugin_ipodexport.desktop
M  +1    -1    jpeglossless/plugin/kipiplugin_jpeglossless.desktop
M  +1    -1    kioexportimport/kipiplugin_kioexportimport.desktop
M  +1    -1    kmlexport/kipiplugin_kmlexport.desktop
M  +1    -1    metadataedit/plugin/kipiplugin_metadataedit.desktop
M  +1    -1    picasawebexport/kipiplugin_picasawebexport.desktop
M  +1    -1    piwigoexport/kipiplugin_piwigoexport.desktop
M  +1    -1    printimages/plugin/kipiplugin_printimages.desktop
M  +1    -1    rajceexport/kipiplugin_rajceexport.desktop
M  +1    -1    rawconverter/plugin/kipiplugin_rawconverter.desktop
M  +1    -1    removeredeyes/plugin/kipiplugin_removeredeyes.desktop
M  +1    -1    sendimages/kipiplugin_sendimages.desktop
M  +1    -1    shwup/kipiplugin_shwup.desktop
M  +1    -1    smug/kipiplugin_smug.desktop
M  +1    -1    timeadjust/kipiplugin_timeadjust.desktop
M  +1    -1    vkontakte/kipiplugin_vkontakte.desktop
M  +1    -1    yandexfotki/kipiplugin_yandexfotki.desktop

http://commits.kde.org/kipi-plugins/7777a73cfdcba6d7b0686c71b529d04e78b18563
Comment 2 Andi Clemens 2011-12-25 14:41:11 UTC
Git commit aabeb36f4d76846ac37c605cadaf029f6d264d89 by Andi Clemens.
Committed on 25/12/2011 at 15:09.
Pushed by aclemens into branch 'master'.

Fix crash when "unloading" plugins
Related: bug 289779

M  +12   -8    libkipi/pluginloader.cpp

http://commits.kde.org/libkipi/aabeb36f4d76846ac37c605cadaf029f6d264d89
Comment 3 Andi Clemens 2011-12-25 19:20:29 UTC
I will close the bugreport for now, if you think we should change the code, please re-open it again.