From: <chr...@us...> - 2006-12-10 17:24:30
|
Revision: 1022 http://svn.sourceforge.net/gridarta/?rev=1022&view=rev Author: christianhujer Date: 2006-12-10 09:24:25 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Fixed a memory leak in daimonin. Hopefully also fixed it for crossfire. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/src/daieditor/CMainView.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 17:03:05 UTC (rev 1021) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 17:24:25 UTC (rev 1022) @@ -531,6 +531,12 @@ mapViews.remove(mapView); mapView.closeNotify(); mapDesktop.remove(mapView); + // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. + // Thus it will still be referenced. To prevent a closed map from being referenced by Swing, + // we check whether it's selected and if so deselect it. + if (mapDesktop.getSelectedFrame() == mapView) { + mapDesktop.setSelectedFrame(null); + } mapView.dispose(); mapDesktop.repaint(); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 17:03:05 UTC (rev 1021) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 17:24:25 UTC (rev 1022) @@ -494,6 +494,12 @@ mapViews.remove(mapView); mapDesktop.remove(mapView); + // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. + // Thus it will still be referenced. To prevent a closed map from being referenced by Swing, + // we check whether it's selected and if so deselect it. + if (mapDesktop.getSelectedFrame() == mapView) { + mapDesktop.setSelectedFrame(null); + } mapView.dispose(); mapDesktop.repaint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |