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

List:       kde-devel
Subject:    Re: Problems with library unloading
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-10-26 19:11:30
[Download RAW message or body]

On Thursday 26 October 2000 05:45, Szymon Stefanek wrote:
> On Thursday 26 October 2000 15:38, David Faure wrote:
> > On Thursday 26 October 2000 12:25, Szymon Stefanek wrote:
> > > I have a small problem related to the library unloading.
> >
> > That's because it's iterating in the list of metaclasses, and it's
> > encountering one that you unloaded but didn't remove from the metaclass
> > list.
>
> mmmh...let me understand more...
> Kvirc loads by itself only "self-made" libraries, with no K* classes
> inside... so I guess that at unload time no K* class should be destroyed...
> ....or I'm wrong ?

It's not about K* classes, it's about any classes that are "moc'ed" (e.g. 
define QOBJECT) and that are defined in the library that is being unloaded.

When you unload a library you must make sure that all references to any code 
in this library is removed before. Otherwise you might end up code that 
doesn't exist any longer. With C++ this means that all objects that have been 
created by the dlopen'ed module should be destroyed before you unload this 
module. (Because C++ has a strong coupling between data and code, e.g. in the 
form of vtables.)

> > You need to use the "metaclass unloading" feature for kvirc's plugins
> > too.
>
> I'll investigate more in this direction.
>
> > Do you use the current admin directory from KDE CVS ?
>
> Actually my admin directory is self-made, but if necessary I'll add the
> support for the "closure" stuff and use klibloader when KDE support is
> compiled in.
>
> > PS: kvirc rocks ! :)
> >
> :)

Ai ai.. rough times ahead for ksirc :-) If scrolling in kvirc sucks less than 
in ksirc I will switch. (Unless it gets fixed in ksirc of course....)

Cheers,
Waldo
-- 
KDE/Linux, you make the choice.
 
>> 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