Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix for memory leak submitted by FredChen #11

Merged
merged 1 commit into from

2 participants

Andrea Antonello Michael Bedward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 21, 2012
  1. Andrea Antonello
This page is out of date. Refresh to see the latest.
12 modules/unsupported/swt/src/main/java/org/geotools/swt/SwtMapPane.java
View
@@ -441,7 +441,8 @@ public void setCrs( CoordinateReferenceSystem crs ) {
fullExtent = null;
doSetDisplayArea(newEnvelope);
- ReferencedEnvelope displayArea = getDisplayArea();
+ // ReferencedEnvelope displayArea =
+ getDisplayArea();
// System.out.println(displayArea);
} catch (Exception e) {
e.printStackTrace();
@@ -1236,6 +1237,15 @@ private void drawFinalImage( Image swtImage ) {
// draw the created new image on the pane
if (gc != null && !gc.isDisposed())
gc.drawImage(tmpImage, imageOrigin.x, imageOrigin.y);
+
+ if (tmpImage != null && !tmpImage.isDisposed()) {
+ tmpImage.dispose();
+ tmpImage = null;
+ }
+ if (tmpGc != null && !tmpGc.isDisposed()) {
+ tmpGc.dispose();
+ tmpGc = null;
+ }
}
@SuppressWarnings("deprecation")
Something went wrong with that request. Please try again.