Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-05-02 17:54:01 +0000
committerChristian W. Damus2014-05-02 17:54:01 +0000
commitadf820391c4133f561c6fd4c5093055c5c5c7b2f (patch)
treececb74b5e6e4f98e8c49a4784d6e867b294d2e9f /plugins/customization
parentdb038d1db6955f448b9ea8deaa3f8c1182178ae3 (diff)
downloadorg.eclipse.papyrus-adf820391c4133f561c6fd4c5093055c5c5c7b2f.tar.gz
org.eclipse.papyrus-adf820391c4133f561c6fd4c5093055c5c5c7b2f.tar.xz
org.eclipse.papyrus-adf820391c4133f561c6fd4c5093055c5c5c7b2f.zip
422257: [Performances] Memory leaks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=422257 More ResourceSet clean-up in the palette customization wizard.
Diffstat (limited to 'plugins/customization')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
index cc68bbff31b..bb9133685ca 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
@@ -270,6 +270,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
if(resourceSet != null) {
EMFHelper.unload(resourceSet);
}
+
+ if(manager != null) {
+ EMFHelper.unload(manager.getResourceSet());
+ }
}
/**
@@ -1738,13 +1742,17 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
public class ExtendedPaletteContentProvider extends CustomizedTreeContentProvider {
+ private CustomizationCatalogManager catalogManager;
+ private ResourceSet catalogManagerResourceSet;
+
/**
* Constructor.
*/
public ExtendedPaletteContentProvider() {
super(manager);
//TODO: EMFFACET refactor this code
- CustomizationCatalogManager catalogManager=(CustomizationCatalogManager)ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(new ResourceSetImpl());
+ catalogManagerResourceSet = new ResourceSetImpl();
+ catalogManager=(CustomizationCatalogManager)ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(catalogManagerResourceSet);
List<Customization> paletteCustomizations =catalogManager.getCustomizationsByName("PaletteConfiguration");
if(paletteCustomizations.size()>0) {
// manager.setShowTypeOfLinks(false);
@@ -1753,6 +1761,18 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
}
}
+ @Override
+ public void dispose() {
+ super.dispose();
+
+ if(catalogManagerResourceSet != null) {
+ EMFHelper.unload(catalogManagerResourceSet);
+ catalogManagerResourceSet = null;
+ }
+
+ catalogManager = null;
+ }
+
/**
* {@inheritDoc}
*/

Back to the top