public final void dispose() { // RAP [rst] safeguard against NPE if (keyboard == null || workbench == null) return; // RAP [rst] move "workbench = null" down to prevent NPE final Listener listener = keyboard.getKeyDownFilter(); final Display display = workbench.getDisplay(); if (display != null) { display.removeFilter(SWT.KeyDown, listener); display.removeFilter(SWT.Traverse, listener); } workbench = null; keyboard = null; bindingPersistence.dispose(); }