mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +02:00
add guard around nodeData on delete
This commit is contained in:
parent
1c2e5eecd6
commit
3ed61db873
1 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,9 @@ void NodeWatcher::nodeKilled(Node* node) {
|
|||
// Use this to cleanup our node
|
||||
if (node->getType() == NODE_TYPE_AGENT) {
|
||||
VoxelNodeData* nodeData = (VoxelNodeData*)node->getLinkedData();
|
||||
node->setLinkedData(NULL);
|
||||
delete nodeData;
|
||||
if (nodeData) {
|
||||
node->setLinkedData(NULL);
|
||||
delete nodeData;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue