Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonas2013-06-20 05:35:10 -0400
committerjonas2013-06-20 05:35:10 -0400
commit076515150145c0923691200014b54b09f586e621 (patch)
tree7d7a66475dca1d86a074f01b37176aa86c596945
parent2db833285f57fe09df0f4492cc33fd29a5dc613a (diff)
downloadorg.eclipse.e4.tools-076515150145c0923691200014b54b09f586e621.tar.gz
org.eclipse.e4.tools-076515150145c0923691200014b54b09f586e621.tar.xz
org.eclipse.e4.tools-076515150145c0923691200014b54b09f586e621.zip
-rw-r--r--bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/PartHelper.java2
-rw-r--r--bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIEditorPart.java11
2 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/PartHelper.java b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/PartHelper.java
index f767bf10..cbe2d201 100644
--- a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/PartHelper.java
+++ b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/PartHelper.java
@@ -42,7 +42,7 @@ public class PartHelper {
Object instance = site.getService(clazz);
Method m = clazz.getMethod("getContext", new Class[0]);
IEclipseContext ctx = (IEclipseContext) m.invoke(instance);
- IEclipseContext rv = ctx.createChild();
+ IEclipseContext rv = ctx;
while( ctx.getParent() != null ) {
ctx = ctx.getParent();
}
diff --git a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIEditorPart.java b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIEditorPart.java
index c135bb13..0c99e15f 100644
--- a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIEditorPart.java
+++ b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIEditorPart.java
@@ -148,8 +148,15 @@ public abstract class DIEditorPart<C> extends EditorPart implements
@Override
public void dispose() {
- context.dispose();
- context = null;
+ IEclipseContext parentContext = (IEclipseContext) getSite().getService(
+ IEclipseContext.class);
+ // Check if running in 3.x, otherwise there was no dedicated context
+ // created
+ if (parentContext
+ .get("org.eclipse.e4.ui.workbench.IPresentationEngine") != null) {
+ context.dispose();
+ context = null;
+ }
super.dispose();
}
}

Back to the top