summaryrefslogtreecommitdiff
path: root/thirdparty/b2d_convexdecomp
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2018-02-26 12:47:58 +0300
committerChaosus <chaosus89@gmail.com>2018-03-03 09:11:26 +0300
commit7c0da76402a6b53237ecec34757f686d2fac642b (patch)
treeec4e66f3f4b62a827b62a91c33962c115a60c9e1 /thirdparty/b2d_convexdecomp
parent7568a455397aeefc1e08600534ec4df279abab70 (diff)
Fix 3 memory leaks
Diffstat (limited to 'thirdparty/b2d_convexdecomp')
-rw-r--r--thirdparty/b2d_convexdecomp/b2Polygon.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/thirdparty/b2d_convexdecomp/b2Polygon.cpp b/thirdparty/b2d_convexdecomp/b2Polygon.cpp
index b6ead62c63..c80204ae21 100644
--- a/thirdparty/b2d_convexdecomp/b2Polygon.cpp
+++ b/thirdparty/b2d_convexdecomp/b2Polygon.cpp
@@ -1342,7 +1342,12 @@ b2Polygon TraceEdge(b2Polygon* p){
if (nodes[j].nConnected == 0) continue;
b2Vec2 diff = nodes[i].position - nodes[j].position;
if (diff.LengthSquared() <= COLLAPSE_DIST_SQR){
- if (nActive <= 3) return b2Polygon();
+ if (nActive <= 3) {
+ // -- GODOT start --
+ delete[] nodes;
+ // -- GODOT end --
+ return b2Polygon();
+ }
//printf("Found dupe, %d left\n",nActive);
--nActive;
foundDupe = true;