mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +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
|
// Use this to cleanup our node
|
||||||
if (node->getType() == NODE_TYPE_AGENT) {
|
if (node->getType() == NODE_TYPE_AGENT) {
|
||||||
VoxelNodeData* nodeData = (VoxelNodeData*)node->getLinkedData();
|
VoxelNodeData* nodeData = (VoxelNodeData*)node->getLinkedData();
|
||||||
node->setLinkedData(NULL);
|
if (nodeData) {
|
||||||
delete nodeData;
|
node->setLinkedData(NULL);
|
||||||
|
delete nodeData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue