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. */