From 5ed6f9269f460853e97a20a6778f9d82bbd02bec Mon Sep 17 00:00:00 2001 From: Diego Barreiro Perez Date: Mon, 15 Jul 2024 20:30:54 +0100 Subject: [PATCH] Fix memory leak in SimplePaletteItem For some reason, App Inventor was creating 2 instances of components every time a component was being dragged. However, the extra instance was not being deleted or cleaned up, losing access to the instance as no pointer was ever referring to it again. --- .../client/editor/simple/palette/SimplePaletteItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/simple/palette/SimplePaletteItem.java b/appinventor/appengine/src/com/google/appinventor/client/editor/simple/palette/SimplePaletteItem.java index 1e18fa2dbce..b1a20851543 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/simple/palette/SimplePaletteItem.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/simple/palette/SimplePaletteItem.java @@ -127,7 +127,7 @@ public MockComponent createMockComponent() { cacheInternalComponentPrototype(); MockComponent returnedComponentPrototype = componentPrototype; - componentPrototype = null; + // componentPrototype = null; return returnedComponentPrototype; }