[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Problems with library unloading
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-10-26 15:20:15
[Download RAW message or body]

On Thursday 26 October 2000 15:01, Falk Brettschneider wrote:
> Hi,
> 
> David Faure wrote:
> 
> > > A relevant detail is that KVIrc loads dynamically its own modules too:
> 
> My application uses dlopen() and dlclose(), too.
> Whenever I shutdown plugins by dlclose(), the application crashes on exit. Without dlclose()
> it works.
> 
> The backtrace in case of using dlclose() is below.
> I don't use a KImageTrackLabel. Does anybody know what happens?

Here we go again :

Those classes register their "metaclass" to Qt, but when you unload them,
Qt's metaclass register has some sort of dangling pointers - the const char*s
that were in the library have been unloaded.

What happens, when it tries to unregister KImageTrackLabel (in your case)
is that it iterates over the list of metaclass, and dies on one that you unloaded
yourself without unregistering it.

The autoconf structure in KDE handles this automatically.
The generated _meta_unload.cpp file holds a static object, that is
deleted when the library is unloaded, and at that point it removes the
metaclasses from Qt's objectDict.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2


>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic