Crash (assertion failure) in v2.0 when deleting Nodes
-
- Gnoblar
- Posts: 21
- Joined: Sun Mar 01, 2015 9:33 pm
- x 4
Crash (assertion failure) in v2.0 when deleting Nodes
Hi,
It seems that Ogre will always crash with an assertion failure if you delete Nodes which have parents. Looking at the code, it looks like it's supposed to remove the node from its parent, but this can't happen.
I've made a JIRA ticket with details: https://ogre3d.atlassian.net/browse/OGRE-479
Happens for me on latest v2-0 branch; hope I tagged it properly.
It seems that Ogre will always crash with an assertion failure if you delete Nodes which have parents. Looking at the code, it looks like it's supposed to remove the node from its parent, but this can't happen.
I've made a JIRA ticket with details: https://ogre3d.atlassian.net/browse/OGRE-479
Happens for me on latest v2-0 branch; hope I tagged it properly.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: Crash (assertion failure) in v2.0 when deleting Nodes
I can see the bug, but you could you please provide a snippet repro code to understand what is triggering this behavior?
-
- Gnoblar
- Posts: 21
- Joined: Sun Mar 01, 2015 9:33 pm
- x 4
Re: Crash (assertion failure) in v2.0 when deleting Nodes
Hmm, it was always intermittent, and now that I write a test case for it, I can't get it to happen. I'm ready to accept I was probably doing something wrong in my app.
-
- Gremlin
- Posts: 196
- Joined: Tue Jan 27, 2009 12:27 am
- x 24
Re: Crash (assertion failure) in v2.0 when deleting Nodes
Maybe when deleting manually a node instead of calling the destroySceneNode function ?
-
- Gnoblar
- Posts: 21
- Joined: Sun Mar 01, 2015 9:33 pm
- x 4
Re: Crash (assertion failure) in v2.0 when deleting Nodes
Ah, nope, got it. This'll do it:
It only happens when the child is created before the parent.
Code: Select all
#include <Ogre/Ogre.h>
int main()
{
Ogre::Root *ogre = new Ogre::Root("plugins.cfg", "render.cfg");
ogre->restoreConfig();
Ogre::RenderWindow *win = ogre->initialise(true);
Ogre::SceneManager *scene = ogre->createSceneManager(Ogre::ST_GENERIC, 1, Ogre::INSTANCING_CULLING_SINGLETHREAD);
Ogre::SceneNode *one = scene->createSceneNode();
Ogre::SceneNode *two = scene->createSceneNode();
two->addChild(one);
scene->clearScene();
}
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: Crash (assertion failure) in v2.0 when deleting Nodes
I'll take a look at this when I get some time.
btw you should create your scenenodes via createChildSceneNode (and grabbing the root scene node to create the first one)
btw you should create your scenenodes via createChildSceneNode (and grabbing the root scene node to create the first one)