Crash (assertion failure) in v2.0 when deleting Nodes

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
rogual
Gnoblar
Posts: 21
Joined: Sun Mar 01, 2015 9:33 pm
x 4

Crash (assertion failure) in v2.0 when deleting Nodes

Post by rogual »

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.
User avatar
dark_sylinc
OGRE Team Member
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

Post by dark_sylinc »

I can see the bug, but you could you please provide a snippet repro code to understand what is triggering this behavior?
rogual
Gnoblar
Posts: 21
Joined: Sun Mar 01, 2015 9:33 pm
x 4

Re: Crash (assertion failure) in v2.0 when deleting Nodes

Post by rogual »

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.
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

Re: Crash (assertion failure) in v2.0 when deleting Nodes

Post by N0vember »

Maybe when deleting manually a node instead of calling the destroySceneNode function ?
rogual
Gnoblar
Posts: 21
Joined: Sun Mar 01, 2015 9:33 pm
x 4

Re: Crash (assertion failure) in v2.0 when deleting Nodes

Post by rogual »

Ah, nope, got it. This'll do it:

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();
}
It only happens when the child is created before the parent.
User avatar
dark_sylinc
OGRE Team Member
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

Post by dark_sylinc »

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)
Post Reply