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

List:       kde-core-devel
Subject:    Re: RFC: Proper destruction of static data?
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-06-27 19:29:31
[Download RAW message or body]

On Tue, Jun 27, 2000 at 09:27:08PM +0200, Harri Porten wrote:
> Werner Trobin wrote:
> > 
> > We #define KSTATIC static and let some magic tool look
> > for KSTATIC in the sources. It extracts all the variable
> > names (only static pointers to objects are allowed) and
> > creates a "clean up" function. This function deletes all
> > the objects when the lib gets unloaded...
> > 
> > Am I completely wrong? Do I miss something important?
> > Comments, suggestions, flames...?
> 
> Sounds very interesting. My comment/suggestion: order of destruction can
> be quite important. Therefore, it has to be well defined and documented.

Right.... Then what about a "user-defined callout (per library)"
where the library's developer does a proper destruction, instead of having
it done automatically ? Hmm, more complex for the developer than just K_STATIC.


Half-related: any widget created by the library and not destroyed
when unloading the lib will lead to crash in Qt, since all widgets are registered
there (see QWidget::mapper). Those are not static, so it's another matter though.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/, 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

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

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