Issue #345 allow double dispose of GLTarget

Change-Id: Ib433557f82bc0bc63fb537814bad47eab00be2be

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

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;