Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-10-22 14:46:38 +0000
committerAnsgar Radermacher2014-10-22 14:47:37 +0000
commit6945f71f5fe7eaf2c6b4e3750f35b87ae01cd964 (patch)
tree135b1286936dc7e28b180b499512a562513a9906 /plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext
parent61442ba86bbb3518c8ebb718e2d5181fc46b0e3b (diff)
downloadorg.eclipse.papyrus-6945f71f5fe7eaf2c6b4e3750f35b87ae01cd964.tar.gz
org.eclipse.papyrus-6945f71f5fe7eaf2c6b4e3750f35b87ae01cd964.tar.xz
org.eclipse.papyrus-6945f71f5fe7eaf2c6b4e3750f35b87ae01cd964.zip
447872 - [OCL in Papyrus] Suspected memory leak in OCL XText Editor when editing a profile
Diffstat (limited to 'plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java
index 11d9def17aa..4ce0fd39fc3 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/XtextLanguageEditor.java
@@ -243,7 +243,15 @@ public class XtextLanguageEditor implements BodyEditor, IContextElementProvider
}
public void dispose() {
- // TODO?
+ // dispose resources to avoid memory leaks
+ if (textControl != null) {
+ textControl.dispose();
+ }
+ if (xtextAdapter != null) {
+ xtextAdapter.getFakeResourceContext().getFakeResource().eAdapters().remove(contextElementAdapter);
+ xtextAdapter.dispose();
+ xtextAdapter = null;
+ }
}
public void addChangeListener(Listener listener) {

Back to the top