Jump to content

[SOLVED] WorldTriggers: Shutdown not possible without crash when reference to non-existing node


photo

Recommended Posts

Hello

 

Pseudo code:

 

WorldTrigger wtOutoing;


void init()
{
wtOutoing = node_cast("some node"));
wtOutoing.setTargetNodes((test.getActor()));
}

void shutdown()
{
// Setting an empty list, no crash
wtOutoing.setTargetNodes(());
wtIngoing.setTargetNodes(());
}

 

 

Error if not overwrite target nodes:

Unigine fatal error
engine/world/worlds/WorldTrigger.cpp:233: void WorldTrigger::removeNode(Node*): Assertion: 'isTargetNode(node) && "WorldTrigger::removeNode(): is not a target node"'
Shutdown
Aborted (core dumped)
./client.sh  45.94s user 

When shutting down all worldtriggers should be overwritten by an empty array or just ignoring their target nodes in the deconstructor (or checking for NULL).

The current behavior leads to a very complicated handling and a difficult debugging. (Nobody expects that the target nodes must be still available while deconstruction the worldtrigger)

 

Link to comment
  • 4 months later...
  • 4 weeks later...

I can't imagine the situation when this crash happened.

All nodes clear their triggers and triggers clear their nodes in the destructors.

A sample is required for fix.

Link to comment
  • 2 weeks later...
  • 1 month later...
×
×
  • Create New...