[osg-users] Deleting still referenced object

Richard Harrison rjh at zaretto.com
Thu Jan 10 09:29:25 PST 2019


On 10/01/2019 17:08, Robert Osfield wrote:
> Hi Richard,
>
> The info you've provided doesn't give us much to go on to understand
This is following on from my (somewhat lengthy) message[1] on 
2019-01-08, 00:15Z which has context at the start of that message, but 
for ease of reading it is as below.

 >Using osg master; self built; application FlightGear; Win32 x64; MSVC 
2015.
 >In FlightGear when OSG warning Warning: deleting still referenced 
object ... the final reference count was" is detected in our 
NotifyHandler we throw an exception (probably the only reliably thing to 
do, as this message generally comes before some sort of segfault).

I appreciate that when viewed out of context the recent message makes no 
sense as it's about my testing of the changes I've made to ObjectCache 
and DatabasePage to use a ReadWriteMutex to ensure that nothing is 
removed from the cache when the DatabasePager thread is in the process 
of adding a new model that references something in the object cache that 
has just expired.

The test is currently at 54.2 hours of flight time - and some 
perfunctory checks in the debugger show that the cache is being 
maintained (objects are expiring); and the message[2] "...cannot check 
for expiry as something is accessing the object cache" indicates that 
the object cache mutext check is working properly (the check uses 
tryLock so rendering performance isn't affected).

I'm still working on my assumption that my original analysis[1] is right 
and it is probably best viewed on the forum as the formatting wasn't 
nice when I posted to the list and I've since cleaned up the forum version.

---------------------
[1] http://forum.openscenegraph.org/viewtopic.php?p=75436#75436
[2] I added the debug message "cannot check for expiry as something is 
accessing the object cache" to indicate that the object cache was 
waiting (tryLock) on the mutex


More information about the osg-users mailing list