JAL-2865 unhelpful System.gc() calls removed
[jalview.git] / src / jalview / gui / Desktop.java
index ad80ca5..569c105 100644 (file)
@@ -360,7 +360,8 @@ public class Desktop extends jalview.jbgui.GDesktop
             new MyDesktopManager(
                     (Platform.isWindows() ? new DefaultDesktopManager()
                             : Platform.isAMac()
-                                    ? new AquaInternalFrameManager()
+                                    ? new AquaInternalFrameManager(
+                                            desktop.getDesktopManager())
                                     : desktop.getDesktopManager())));
 
     Rectangle dims = getLastKnownDimensions("");
@@ -868,6 +869,10 @@ public class Desktop extends jalview.jbgui.GDesktop
         JInternalFrame itf = desktop.getSelectedFrame();
         if (itf != null)
         {
+          if (itf instanceof AlignFrame)
+          {
+            Jalview.setCurrentAlignFrame((AlignFrame) itf);
+          }
           itf.requestFocus();
         }
       }
@@ -894,16 +899,6 @@ public class Desktop extends jalview.jbgui.GDesktop
           menuItem.removeActionListener(menuItem.getActionListeners()[0]);
         }
         windowMenu.remove(menuItem);
-        JInternalFrame itf = desktop.getSelectedFrame();
-        if (itf != null)
-        {
-          itf.requestFocus();
-          if (itf instanceof AlignFrame)
-          {
-            Jalview.setCurrentAlignFrame((AlignFrame) itf);
-          }
-        }
-        System.gc();
       };
     });
 
@@ -1391,7 +1386,6 @@ public class Desktop extends jalview.jbgui.GDesktop
     {
       ssm.resetAll();
     }
-    System.gc();
   }
 
   @Override
@@ -2341,7 +2335,7 @@ public class Desktop extends jalview.jbgui.GDesktop
           {
             String link = li.next();
             if (link.contains(SEQUENCE_ID)
-                    && !link.equals(UrlConstants.DEFAULT_STRING))
+                    && !UrlConstants.isDefaultString(link))
             {
               check = true;
               int barPos = link.indexOf("|");