]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Reduce memory leaks caused by query cache referring to disposed UI 13/4813/2
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 28 Dec 2021 11:52:39 +0000 (13:52 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 28 Dec 2021 12:02:21 +0000 (12:02 +0000)
components

gitlab #789

Change-Id: If2092924c8be66795d35d52a2e6a0fa510d5f2d2

bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/NatTableGraphExplorer.java
bundles/org.simantics.selectionview/src/org/simantics/selectionview/PropertyPage.java
bundles/org.simantics.selectionview/src/org/simantics/selectionview/StandardPropertyPage.java

index 9d12fd9b592f70e44bf842819cee245f2b596beb..c05b3b4084dc772a7a06e8e37e62957241a2cb87 100644 (file)
@@ -1044,10 +1044,12 @@ public class NatTableGraphExplorer extends GraphExplorerImplBase implements Grap
         columns = null;
         columnKeyToIndex.clear();
         columnKeyToIndex = null;
+// Disposing NatTable here causes SWT isDisposed exception when GraphExplorer composite disposes DragSource.        
 //        if (natTable != null) {
 //                     natTable.dispose();
 //                     natTable = null;
 //             }
+        natTable = null;
                treeLayer = null;
                dataLayer = null;
                viewportLayer = null;
index eb4caaebaf0b014e4de0ae124377a8658620172a..0f700d1d395d81acec3d37d5e2ec9f301f5ff29d 100644 (file)
@@ -125,6 +125,7 @@ public class PropertyPage extends AbstractPropertyPage implements IPropertyPage,
         super.dispose();
         tab = null;
         sessionContext = null;
+        propertyPageView = null;
     }
 
     protected ISessionContextProvider getSessionContextProvider() {
index f0b618f6e961679ef77cc34f1aea47d76f5ba357..6229cd3f4470f2009728964732c1b0955997234f 100644 (file)
@@ -91,6 +91,12 @@ public class StandardPropertyPage extends PropertyPage {
     protected Set<String> getContexts() {
         return contexts;
     }
+    
+    @Override
+    public void dispose() {
+        super.dispose();
+        tabs = null;
+    }
 
     @SuppressWarnings("unchecked")
     @Override