aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-10-17 15:31:50 (EDT)
committerOleg Besedin2012-10-17 15:32:24 (EDT)
commit1e8f1f19c0036d01405e2041d220374a457e3bb8 (patch)
treec1deced44f813e8b93d03ae13c51eb401bc79372
parentf5649a39732b647cad70c58dc3e3b0d40e22f117 (diff)
downloadeclipse.platform.ui-1e8f1f19c0036d01405e2041d220374a457e3bb8.zip
eclipse.platform.ui-1e8f1f19c0036d01405e2041d220374a457e3bb8.tar.gz
eclipse.platform.ui-1e8f1f19c0036d01405e2041d220374a457e3bb8.tar.bz2
Bug 389250 - Lots of stuff leaked when closing and reopening views v20121017-193224
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java
index 820ab1f..16cc2f7 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionAggregator.java
@@ -24,6 +24,8 @@ import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.contexts.RunAndTrack;
import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.internal.contexts.EclipseContext;
+import org.eclipse.e4.core.internal.contexts.IContextDisposalListener;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
@@ -144,6 +146,14 @@ public class SelectionAggregator {
final IEclipseContext myContext = this.context;
IEclipseContext context = part.getContext();
if (context != null && tracked.add(context)) {
+ if (context instanceof EclipseContext) {
+ ((EclipseContext) context).notifyOnDisposal(new IContextDisposalListener() {
+ public void disposed(IEclipseContext context) {
+ tracked.remove(context);
+ }
+ });
+ }
+
context.runAndTrack(new RunAndTrack() {
private boolean initial = true;