One more thing
In SceneManager::removeNode, when the parent pointer is used it is check to make sure its not null:
Code:
// Raise event
if( sn->_parent != 0x0 ) sn->_parent->onDetach( *sn );
but then later in the same function the pointer is used without checking:
Code:
sn->_parent->markDirty();
should that line actually be like this?:
Code:
if( sn->_parent != 0x0 ) sn->_parent->markDirty();
----------------
Also, when I reported the "return" bug, I was using 0.8. I've just upgraded my engine to use 0.9, but now it's crashing in SceneManager::removeNode on the 'delete' statement on this line:
Code:
// Delete node
delete _nodes[id - 1]; _nodes[id - 1] = 0x0;
The stack trace says:
0x10096865 std::allocator<SceneNode*>::~allocator (C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:103)
I was going to report this as a bug, but if I compile the "chicago" sample, this crash does not happen - it only happens in my code, so I guess I've made a mistake somewhere! I'll let you know when I find out more (I'm guessing I'm calling removeNode twice on the same ID or something like that...).