Issue #345 allow double dispose of GLTarget

Change-Id: Ib433557f82bc0bc63fb537814bad47eab00be2be

Former-commit-id: b776d953d7 [formerly 06c9d4cdcf] [formerly b776d953d7 [formerly 06c9d4cdcf] [formerly 55aa66a510 [formerly 8b906b245fd927ed79825b00dfba456a1c327fbb]]]
Former-commit-id: 55aa66a510
Former-commit-id: c3d3142bab [formerly 5d6b036ed7]
Former-commit-id: 8f34946969
This commit is contained in:
Ben Steffensmeier 2012-02-22 17:40:48 -06:00
parent 0d56994428
commit 16d205ce9d

View file

@ -559,17 +559,20 @@ public class GLTarget implements IGLTarget {
*/
@Override
public void dispose() {
theContext.makeContextCurrent();
if (defaultFont != null) {
defaultFont.disposeInternal();
defaultFont = null;
}
if (colorbarFont != null) {
colorbarFont.disposeInternal();
colorbarFont = null;
}
theContext.releaseContext();
theContext.destroyContext();
if (theCanvas != null && theCanvas.isDisposed() == false) {
theCanvas.removeListener(SWT.Resize, this.canvasResizeListener);
}
lastColormapUsed = null;