Fixed #21 - IllegalStateException when closing SCViewer
This commit is contained in:
parent
7b2db09585
commit
c7c1f97b0c
|
@ -60,6 +60,7 @@ import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.swt.widgets.ToolBar;
|
import org.eclipse.swt.widgets.ToolBar;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
import org.eclipse.swt.widgets.ToolItem;
|
||||||
|
@ -373,9 +374,13 @@ public class DesignBrowser {
|
||||||
waveformViewerPart.addDisposeListener( new DisposeListener() {
|
waveformViewerPart.addDisposeListener( new DisposeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetDisposed(DisposeEvent e) {
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
// reset tree- and tableviewer
|
Control control = treeViewer.getControl();
|
||||||
resetTreeViewer();
|
// check if widget is already disposed (f.ex. because of workbench closing)
|
||||||
}
|
if (control == null || control.isDisposed()) { //if so: do nothing
|
||||||
|
}else { //reset tree- and tableviewer
|
||||||
|
resetTreeViewer();
|
||||||
|
}
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
this.waveformViewerPart=waveformViewerPart;
|
this.waveformViewerPart=waveformViewerPart;
|
||||||
|
|
Loading…
Reference in New Issue