Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-05-02 20:07:07 +0000
committerChristian W. Damus2014-05-02 20:07:07 +0000
commit29bc0d14baaa9d09746dbbbbc514ef9f2be3fc2a (patch)
tree1ef849965ce31d59fb16cb0fb84ac09cdb2724cd /extraplugins
parent038293ea323d0fc701e6285ab0c3f131d8738681 (diff)
downloadorg.eclipse.papyrus-29bc0d14baaa9d09746dbbbbc514ef9f2be3fc2a.tar.gz
org.eclipse.papyrus-29bc0d14baaa9d09746dbbbbc514ef9f2be3fc2a.tar.xz
org.eclipse.papyrus-29bc0d14baaa9d09746dbbbbc514ef9f2be3fc2a.zip
422257: [Performances] Memory leaks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=422257 ResourceSet clean-up in CDO repository model export utilities.
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/wizards/LocalRepositoryView.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/wizards/LocalRepositoryView.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/wizards/LocalRepositoryView.java
index 3dcd693dc40..9864fa21a98 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/wizards/LocalRepositoryView.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/wizards/LocalRepositoryView.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.cdo.internal.ui.wizards;
@@ -23,9 +25,12 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.papyrus.cdo.core.IPapyrusRepository;
import org.eclipse.papyrus.cdo.internal.core.CDOProxyResolvingResourceSet;
+import org.eclipse.papyrus.cdo.internal.core.CDOUtils;
import org.eclipse.papyrus.cdo.internal.core.IInternalPapyrusRepository;
import org.eclipse.papyrus.cdo.internal.core.PapyrusRepositoryManager;
+import org.eclipse.papyrus.cdo.internal.ui.Activator;
import org.eclipse.papyrus.cdo.internal.ui.views.DIModel;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -49,10 +54,27 @@ public class LocalRepositoryView {
*/
public void dispose() {
for(Map.Entry<IPapyrusRepository, CDOView> next : localViews.entrySet()) {
- next.getKey().close(next.getValue().getResourceSet());
+ CDOView view = next.getValue();
+ try {
+ CDOUtils.unload(view);
+ } catch (Exception e) {
+ Activator.error("Exception in unloading CDO repository view.", e); //$NON-NLS-1$
+ } finally {
+ next.getKey().close(view.getResourceSet());
+ }
}
localViews.clear();
+
+ if(rset != null) {
+ try {
+ EMFHelper.unload(rset);
+ } catch (Exception e) {
+ Activator.error("Exception in unloading CDO repository view's resource set.", e); //$NON-NLS-1$
+ } finally {
+ rset = null;
+ }
+ }
}
/**

Back to the top