<div dir="ltr">Hi Community,<div><br></div><div>I've been fighting with cleaning of ref_ptrs when using osgShadow. It crashes in deleting the pointer. This is odd but attached is very simple example, osgviewer just with adding it to a shadowed scene with some technique.</div><div><br></div><div>Any clue? Sample attached</div><div><br></div><div><br></div><div>Thanks a bunch as always !</div><div><br></div><div>Cheers,</div><div>Nick</div><div><br></div><div><div>void Referenced::signalObserversAndDelete(bool signalDelete, bool doDelete) const</div><div>{</div><div>#if defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)</div><div> ObserverSet* observerSet = static_cast<ObserverSet*>(_observerSet.get());</div><div>#else</div><div> ObserverSet* observerSet = static_cast<ObserverSet*>(_observerSet);</div><div>#endif</div><div><br></div><div> if (observerSet && signalDelete)</div><div> {</div><div> observerSet->signalObjectDeleted(const_cast<Referenced*>(this));</div><div> }</div><div><br></div><div> if (doDelete)</div><div> {</div><div> if (_refCount!=0)</div><div> OSG_NOTICE<<"Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount="<<_refCount<<std::endl;</div><div><br></div><div> if (getDeleteHandler()) deleteUsingDeleteHandler();</div><div> CRASHES HERE -----> else delete this;</div><div> }</div><div>}</div><div><br></div>-- <br><div class="gmail_signature">trajce nikolov nick<br></div>
</div></div>