File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/part Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -291,4 +291,12 @@ protected final void checkSite(IWorkbenchPartSite site) {
291291 Assert .isTrue (site instanceof IEditorSite , "The site for an editor must be an IEditorSite" ); //$NON-NLS-1$
292292 }
293293
294+ @ Override
295+ public void dispose () {
296+ if (compatibilityTitleListener != null ) {
297+ removePropertyListener (compatibilityTitleListener );
298+ compatibilityTitleListener = null ;
299+ }
300+ super .dispose ();
301+ }
294302}
Original file line number Diff line number Diff line change @@ -153,18 +153,21 @@ public abstract class MultiPageEditorPart extends EditorPart implements IPageCha
153153
154154 private ListenerList <IPageChangedListener > pageChangeListeners = new ListenerList <>(ListenerList .IDENTITY );
155155
156+ private org .eclipse .jface .util .IPropertyChangeListener propertyChangeListenerToUpdateContainer ;
157+
156158 /**
157159 * Creates an empty multi-page editor with no pages and registers a
158160 * {@link PropertyChangeListener} to listen for changes to the editor's
159161 * preference..
160162 */
161163 protected MultiPageEditorPart () {
162164 super ();
163- getAPIPreferenceStore (). addPropertyChangeListener ( event -> {
165+ propertyChangeListenerToUpdateContainer = event -> {
164166 if (isUpdateRequired (event )) {
165167 updateContainer ();
166168 }
167- });
169+ };
170+ getAPIPreferenceStore ().addPropertyChangeListener (propertyChangeListenerToUpdateContainer );
168171 }
169172
170173 /**
@@ -526,6 +529,11 @@ protected IEditorSite createSite(IEditorPart editor) {
526529 */
527530 @ Override
528531 public void dispose () {
532+ IPreferenceStore store = getAPIPreferenceStore ();
533+ if (propertyChangeListenerToUpdateContainer != null ) {
534+ store .removePropertyChangeListener (propertyChangeListenerToUpdateContainer );
535+ propertyChangeListenerToUpdateContainer = null ;
536+ }
529537 if (getSite () != null ) {
530538 deactivateSite (true , false );
531539 }
You can’t perform that action at this time.
0 commit comments