Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-27 18:48:54 +0000
committerChristian W. Damus2014-03-27 18:49:10 +0000
commitaca683fb78056238b7a5e533f55abf8b2e6ba0aa (patch)
tree7a73777adc34e9390ce1936e4bfc310c66b5d956 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline
parentee4591bbe74a80517780f021db9e550da17fbe79 (diff)
downloadorg.eclipse.papyrus-aca683fb78056238b7a5e533f55abf8b2e6ba0aa.tar.gz
org.eclipse.papyrus-aca683fb78056238b7a5e533f55abf8b2e6ba0aa.tar.xz
org.eclipse.papyrus-aca683fb78056238b7a5e533f55abf8b2e6ba0aa.zip
410346: Sudden performance degradation e.g. of the Outline View update.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410346 Fix proliferation of item-provider adapters on model elements due to CompositeAdapterFactories being repeatedly created but never disposed.
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline/src/org/eclipse/papyrus/infra/gmfdiag/outline/DiagramNavigator.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline/src/org/eclipse/papyrus/infra/gmfdiag/outline/DiagramNavigator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline/src/org/eclipse/papyrus/infra/gmfdiag/outline/DiagramNavigator.java
index 437e8de24d1..ffdb29e723f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline/src/org/eclipse/papyrus/infra/gmfdiag/outline/DiagramNavigator.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.outline/src/org/eclipse/papyrus/infra/gmfdiag/outline/DiagramNavigator.java
@@ -1,5 +1,5 @@
/***********************************************************************
- * Copyright (c) 2007, 2008, 2009 Anyware Technologies, Obeo.
+ * Copyright (c) 2007, 2014 Anyware Technologies, Obeo, CEA, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* Anyware Technologies - initial API and implementation
* Obeo
+ * Christian W. Damus (CEA) - bug 410346
*
**********************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.outline;
@@ -20,6 +21,7 @@ import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IDisposable;
import org.eclipse.emf.edit.provider.IViewerNotification;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
@@ -155,7 +157,17 @@ public class DiagramNavigator extends Composite {
* Set the tree providers for the outline
*/
protected void initProviders() {
- AdapterFactoryContentProvider adapterContentProvider = new NavigatorAdapterFactoryContentProvider(getAdapterFactory());
+ final AdapterFactory adapterFactory = getAdapterFactory();
+ AdapterFactoryContentProvider adapterContentProvider = new NavigatorAdapterFactoryContentProvider(adapterFactory) {
+ @Override
+ public void dispose() {
+ // Dispose the adapter factory because we created it
+ if(adapterFactory instanceof IDisposable) {
+ ((IDisposable)adapterFactory).dispose();
+ }
+ super.dispose();
+ }
+ };
adapterContentProvider.inputChanged(viewer, null, null);
viewer.setContentProvider(new DiagramOrientedContentProvider(adapterContentProvider));
try {

Back to the top