]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/scl/SCLSessionManager.java
Some fixes for resource cleaning spreadsheets in simupedia
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / scl / SCLSessionManager.java
index 8fe0c7095dfe61557e73e289a8bad66bc0a1e721..af036026b7b90a25829366d41f9a5929cd645d80 100644 (file)
@@ -51,8 +51,12 @@ public class SCLSessionManager {
     }
     
     public static synchronized void removeRealm(String id) {
     }
     
     public static synchronized void removeRealm(String id) {
-        CONNECTIONS.remove(id);
+        SCLRealm realm = CONNECTIONS.remove(id);
+        if (realm != null)
+            realm.close();
         // if node support has been created remove it as well
         // if node support has been created remove it as well
-        SUPPORTS.remove(id);
+        NodeSupport<String> support = SUPPORTS.remove(id);
+        if (support != null)
+            support.dispose();
     }
 }
     }
 }