From 5526e662a8c421cb49b298a2932a55819820dcae Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 8 Jan 2018 11:39:07 +0000 Subject: [PATCH] JAL-2864 OverviewCanvas.dispose() for applet --- src/jalview/appletgui/OverviewCanvas.java | 8 ++++++++ src/jalview/appletgui/OverviewPanel.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/jalview/appletgui/OverviewCanvas.java b/src/jalview/appletgui/OverviewCanvas.java index 9597b44..03c93fa 100644 --- a/src/jalview/appletgui/OverviewCanvas.java +++ b/src/jalview/appletgui/OverviewCanvas.java @@ -164,4 +164,12 @@ public class OverviewCanvas extends Component } } + /** + * Nulls references to protect against potential memory leaks + */ + void dispose() + { + od = null; + } + } diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index 8ce597d..4f47913 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -329,6 +329,10 @@ public class OverviewPanel extends Panel implements Runnable, } finally { av = null; + if (oviewCanvas != null) + { + oviewCanvas.dispose(); + } oviewCanvas = null; ap = null; od = null; -- 1.7.10.2