Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2014-03-25 15:04:16 +0000
committerCedric Dumoulin2014-03-25 15:04:16 +0000
commitec458dd4452adde83b407fd847375b50463363da (patch)
tree46b26ca6fc52d1b05c807c897ea365b06e47ab6d /extraplugins/layers
parent39fa5fbfca2e49d3aeb359ab773f7cf4072b4471 (diff)
downloadorg.eclipse.papyrus-ec458dd4452adde83b407fd847375b50463363da.tar.gz
org.eclipse.papyrus-ec458dd4452adde83b407fd847375b50463363da.tar.xz
org.eclipse.papyrus-ec458dd4452adde83b407fd847375b50463363da.zip
431121-[layers] - Use lookupLayerStackApplication instead of
getLayerStackApplication in dispose(). The getLayerStackApplication() method try to create the object if it is not found. But, if we are in the dispose mode, we should not create object.
Diffstat (limited to 'extraplugins/layers')
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersStackApplicationEventNotifier.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersStackApplicationEventNotifier.java b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersStackApplicationEventNotifier.java
index 7680fc091f9..faa10ed9415 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersStackApplicationEventNotifier.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/src/org/eclipse/papyrus/layers/runtime/LayersStackApplicationEventNotifier.java
@@ -111,10 +111,12 @@ public class LayersStackApplicationEventNotifier {
* Deactivate listeners
*/
protected void deactivate() {
- LayersStackApplication application = layersModel.getLayerStackApplication();
-
- application.eAdapters().remove( layerStackListener );
-
+ // The application can be already deactivated (because we are in dispose()
+ // See bug 431121
+ LayersStackApplication application = layersModel.lookupLayerStackApplication();
+ if( application != null) {
+ application.eAdapters().remove( layerStackListener );
+ }
}
/**

Back to the top