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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user