From 4f9bb7ab230aaf86d83d2748c7f4cd9f1c91d2fa Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Thu, 22 Oct 2015 16:09:50 +0200 Subject: [PATCH] Fix memory leak in Recent Recent menu was keeping Editors in memory --- app/src/processing/app/ui/Recent.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/src/processing/app/ui/Recent.java b/app/src/processing/app/ui/Recent.java index 4cf644e1a..11599374e 100644 --- a/app/src/processing/app/ui/Recent.java +++ b/app/src/processing/app/ui/Recent.java @@ -351,12 +351,6 @@ public class Recent { String path; // if not loaded, this is non-null // EditorState state; // if not loaded, this is non-null - /** - * If currently loaded, this is non-null, and takes precedence over the - * path and state information, which will instead be stored actively by - * the actual sketch object. - */ - Editor editor; // Sketch sketch; // Record(String path, EditorState state) { @@ -374,14 +368,10 @@ public class Recent { // } Record(Editor editor) { - this.editor = editor; - this.path = editor.getSketch().getMainFilePath(); + this(editor.getSketch().getMainFilePath()); } String getName() { - if (editor != null) { - return editor.getSketch().getName(); - } // Get the filename of the .pde (or .js or .py...) String name = path.substring(path.lastIndexOf(File.separatorChar) + 1); // Return the name with the extension removed