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

List:       kde-devel
Subject:    KLibrary life time
From:       Stefan Schimanski <1Stein () gmx ! de>
Date:       2000-04-20 16:57:58
[Download RAW message or body]

Hi,
I was just looking into the source of KLibLoader and KLibrary. At the moment
KLibLoader manages a list of created KLibrary objects. When the same library is
to be loaded more than once, the registered KLibrary is returned.
The caller doesn't need to know about this and will delete the KLibrary object
at the end. But this can be fatal because either a KLibrary is deleted twice
this way and moreover their is no unregistering from KLibLoader. This results in
an invalid KLibrary pointer on following load requests.
I would like to add correct reference managment to KLibrary to avoid those
problems. This would look like this:

Every load request will return its OWN KLibrary instance. KLibLoader will
hold a reference counter to every lib and will close it after all KLibraries are
deleted. This way every caller gets its own KLibrary instance and can delete
this as he likes.

Is this ok for everybody?

Stefan

--  --
      o Stefan Schimanski <1Stein@gmx.de>
  ( )   Homepage: http://1Stein.home.pages.de
o       PGP: http://members.xoom.com/onestone/dh.asc

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

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