Skip to content

Commit

Permalink
Don't try to dispose the clipboard if the display is already disposed.
Browse files Browse the repository at this point in the history
This avoids error during shutdown.
  • Loading branch information
pmuetschard committed Jul 26, 2019
1 parent b828cc2 commit 338bb67
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gapic/src/main/com/google/gapid/widgets/CopyPaste.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ public CopyPaste(Display display) {
}

public void dispose() {
display.removeFilter(SWT.FocusIn, focusListener);
display.removeFilter(SWT.FocusOut, focusListener);
clipboard.dispose();
if (!display.isDisposed()) {
display.removeFilter(SWT.FocusIn, focusListener);
display.removeFilter(SWT.FocusOut, focusListener);
clipboard.dispose();
}
}

public void registerCopySource(Control focusReceiver, CopySource source) {
Expand Down

0 comments on commit 338bb67

Please sign in to comment.