From Stephan Huber, "just a follow-up: I looked at the code of osg/Referenced.cpp and notice

a discrepancy in getOrCreateObserverSet. For the atomic- and
mutex-codepaths the newly created observerset gets manually ref'ed, but
not in the codepath used when OPENTHREADS_ATOMIC_USE_MUTEX is defined. I
added the manual ref and tadaaa, the crash went away."
This commit is contained in:
Robert Osfield
2010-10-04 11:29:39 +00:00
parent b9f0efecb1
commit e6559af283

View File

@@ -282,7 +282,11 @@ ObserverSet* Referenced::getOrCreateObserverSet() const
}
else
{
if (!_observerSet) _observerSet = new ObserverSet(this);
if (!_observerSet)
{
_observerSet = new ObserverSet(this);
static_cast<ObserverSet*>(_observerSet)->ref();
}
return static_cast<ObserverSet*>(_observerSet);
}
#endif