[Kde-imaging] Should plugins be unloaded before app exit?

Renchi Raju renchi at pooh.tam.uiuc.edu
Sun Jul 18 18:19:28 CEST 2004



On Sun, 18 Jul 2004, Jesper K. Pedersen wrote:

> I found a crash in the camera client plugin, where the plugin on exit tries to
> save its data using KGlobal.
>
> This is, however, after kimdaba has started deleting itself (I guess), the
> error was:
> #9  0x410ed178 in qFatal (
>     msg=0x4099ef20 "Fatal error: you need to have a KInstance object
> before\nyou do anything that requires it! Examples of this are
> config\nobjects, standard directories or translations.") at
> tools/qglobal.cpp:574
> #10 0x408db81d in KGlobal::dirs ()
>     at /packages/kde-src/kdelibs/kdecore/kglobal.cpp:55
>
> Now my question is:
> Should we either requested from the host apps that they properly unloads
> plugins before existing, or should we instead tell plugins not to implement
> anything in their destructors?

for added safety, it might be advisable to unload the plugins. on the
other hand, its wrong for a plugin to do stuff in its destructor. a
plugin's config can be changed only if its run. say, user runs the camera
plugin, it loads up the window and when its finished (operation
completed/window closed), it should save the config then (if modified),
and not it in its destructor.

renchi


More information about the Kde-imaging mailing list