mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 13:50:04 +00:00
fix memory leak due to custom container not handling copy operator for recursive containers
This commit is contained in:
parent
36738b7676
commit
dc19da18ee
@ -105,7 +105,17 @@ static inline btDbvtNode* buildTreeBottomUp(btAlignedObjectArray<btDbvtNode*>& l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
leafNodes = newLeafNodes;
|
leafNodes = newLeafNodes;
|
||||||
adj = newAdj;
|
//this assignment leaks memory, the assignment doesn't do a deep copy, for now a manual copy
|
||||||
|
//adj = newAdj;
|
||||||
|
adj.clear();
|
||||||
|
adj.resize(newAdj.size());
|
||||||
|
for (int i = 0; i < newAdj.size(); i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < newAdj[i].size(); j++)
|
||||||
|
{
|
||||||
|
adj[i].push_back(newAdj[i][j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
N = leafNodes.size();
|
N = leafNodes.size();
|
||||||
}
|
}
|
||||||
return leafNodes[0];
|
return leafNodes[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user