Jump to content

[SOLVED] Ptr Problems


photo

Recommended Posts

Posted

So, I have something nice and simple.

 

 

Unigine::Engine *engine = Unigine::Engine::init(UNIGINE_VERSION, acrgc, argv, NULL);

 

for(initialize for loop)

{

  Unigine::ObjectDynamicPtr obj = Unigine::ObjectDynamic::create();

 

  *do stuff - even if all of this is commented out it crashes

 

  Unigine::Editor::get()->addNode(obj->getNode());

}

 

While(engine->isDone() == 0)

{

  engine->update();

  engine->render();

  engine->swap();

}

 

The problem is that it always crashes on update.  I've tried to release the obj Ptr but that doesn't work either.  Anybody have an idea?

Posted

Found the solution.  When I was releasing I was releasing the node; not the dynamic object.  Cut and paste error on my part.

obj->getNode()->release() instead of obj->release();

 

Works now.

×
×
  • Create New...