From 415a6cbb276077f4a61bb077fd5a1df02fa376f4 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 2 Dec 2003 15:58:37 +0000 Subject: [PATCH] =?UTF-8?q?Adding=20dispose()=20as=20suggested=20by=20J?= =?UTF-8?q?=C3=BCrg=20Lehni=20on=20helma-dev.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/helma/image/ImageWrapper.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/helma/image/ImageWrapper.java b/src/helma/image/ImageWrapper.java index f827ce0a..cc68bb19 100644 --- a/src/helma/image/ImageWrapper.java +++ b/src/helma/image/ImageWrapper.java @@ -81,6 +81,16 @@ public abstract class ImageWrapper { } + /** + * Dispose the Graphics context and null out the image. + */ + public void dispose() { + if (img != null) { + g.dispose(); + img = null; + } + } + /** * Set the font used to write on this image. */