Hi, On Thu, 2009-03-05 at 17:51 -0600, Aron Bierbaum wrote: > I believe that the de-constructors for Locks and CondVars are protected > though.
As Carsten said they are Memory Objects, either use a RefCountPtr, e.g. LockRefPtr or call addRef/subRef manually. > > On Thu, Mar 5, 2009 at 4:49 PM, Carsten Neumann <[email protected]> > wrote: > > Hello Aron, > > > > Aron Bierbaum wrote: > >> How are you supposed to clean up a lock that is managed by OpenSG. It > >> appears that you can remove it from the ThreadManager using > >> removeLock(). This method does not delete the Lock though, and if it > >> did the deconstructor of the Lock actually calls back into > >> ThreadManager::removeLock(). > > > > AFAIUI the idea is to delete the lock (i.e. have it go out of scope or > > call delete on it) and it will deregister itself from the ThreadManager. > > > >> I know that people really shouldn't be > >> allocating Locks all that much, I just noticed it with the debug > >> output I received while using the debug build: > >> > >> WARNING: ThreadManager::shutdown: condvar > >> [BackgroundLoader-CondVar|0B907870] is still alive > >> WARNING: ThreadManager::shutdown: lock [OSG::Log::_pLogLock|0887FFD8] > >> is still alive > >> WARNING: ThreadManager::shutdown: lock [OSGTMStoreLock|0863C208] is still > >> alive > >> WARNING: ThreadManager::shutdown: lock > >> [PerfMonitor::mDataLock|0888DFC8] is still alive > > > > However during system shutdown (specifically ThreadManager shutdown) > > this does not happen (see the early out if in > > ThreadManager::removeLock). As said before the Log and Threadmanager ones (see below) are ok, those can't be deleted at the point in time the check is run, but the will be deleted afterwards so they don't leak, checked with valgrind. So please ignore those messages. WARNING: ThreadManager::shutdown: thread [OSGAppThread|0x2183890] is still alive ([1]). WARNING: ThreadManager::shutdown: lock [OSG::Log::_pLogLock|0x222c220] is still alive WARNING: ThreadManager::shutdown: lock [OSGTMStoreLock|0x21837d0] is still alive kind regards, gerrit ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
