Browse code

BM-12913 Fix: dispose removed body

David Phan authored on 08/03/2018 11:00:06
Showing 1 changed files
... ...
@@ -74,7 +74,10 @@ public class AddDisclaimer {
74 74
 	}
75 75
 
76 76
 	private static void replaceBody(Entity e, Body body) {
77
-		e.removeBody();
77
+		Body removedBody = e.removeBody();
78
+		if (removedBody != null) {
79
+			removedBody.dispose();
80
+		}
78 81
 		e.setBody(body);
79 82
 	}
80 83