/** Disposes of all resources associated with a particular instance of the ScreenshotWorker. */ public void dispose() { if (paintSurface != null) { paintSurface.dispose(); } if (imageBundle != null) { imageBundle.dispose(); imageBundle = null; } paintColors = null; paintSurface = null; freeResources(); }