Revision: 6371
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6371&view=rev
Author: wis775
Date: 2011-08-20 14:46:43 +0000 (Sat, 20 Aug 2011)
Log Message:
-----------
When the Session is closed, do some housekeeping and remove all SQLResultTabs.
This would be not be necessary, if all closed Sessions will be ready for garbage collecting. Often, some code keeps a reference to this session and the Session is not ready for garbage collecting. E.g. when dialogs are only set to visible = false and not disposed correctly.
To reduced the used memory by such not reachable sessions, we remove all SQLResultTabs, when the session is closed.
This helps users, they often open and close sessions without restarting SQuirrel.
Modified Paths:
--------------
trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/Session.java
Modified: trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/Session.java
===================================================================
--- trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/Session.java 2011-08-20 09:34:36 UTC (rev 6370)
+++ trunk/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/session/Session.java 2011-08-20 14:46:43 UTC (rev 6371)
@@ -323,6 +323,20 @@
_sessionSheet.sessionHasClosed();
_sessionSheet = null;
}
+
+ /*
+ * If the session is closed, we can remove all SQLResultTabs.
+ * This would be not be necessary, if all closed Sessions will be ready for garbage collecting.
+ * Often, some code keeps a reference to this session and the Session is not ready for garbage collecting.
+ * E.g. when dialogs are only set to visible = false and not disposed correctly.
+ * To reduced the used memory by such not reachable sessions, we remove all SQLResultTabs, when the session is closed.
+ * This helps users, they often open and close sessions without restarting SQuirrel.
+ */
+ if(_sessionInternalFrame != null){
+ _sessionInternalFrame.getSQLPanelAPI().closeAllSQLResultTabs();
+ }
+
+
}
if (s_log.isDebugEnabled()) {
s_log.debug("Successfully closed session: " + _id);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|