From: gmungoc Date: Mon, 8 Jan 2018 11:39:07 +0000 (+0000) Subject: JAL-2864 OverviewCanvas.dispose() for applet X-Git-Tag: Release_2_11_1_0~94^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5526e662a8c421cb49b298a2932a55819820dcae;p=jalview.git JAL-2864 OverviewCanvas.dispose() for applet --- 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;