Revision: 4813
          http://sourceforge.net/p/vexi/code/4813
Author:   mkpg2
Date:     2015-08-31 22:59:34 +0000 (Mon, 31 Aug 2015)
Log Message:
-----------
Block in LauncherMain.run if error window open. 
- believe when running from webstart process exits because main thread 
finishes, even though the error log is open (it flashes open).

Modified Paths:
--------------
    trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/LauncherMain.java
    trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Log.java

Modified: 
trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/LauncherMain.java
===================================================================
--- trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/LauncherMain.java   
2015-08-05 10:32:57 UTC (rev 4812)
+++ trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/LauncherMain.java   
2015-08-31 22:59:34 UTC (rev 4813)
@@ -77,7 +77,7 @@
                log.error("Unexpected problem");
             log.error(e);
                }
-               
+               log.alive.block();
        }
        
        
@@ -126,7 +126,7 @@
        void fetchArgs() throws Exception{
                params = new LinkedHashMap();
                String args = readString(applicationUrl+"/launcher/args");
-               String[] argArr = args.split("\\s+");
+               String[] argArr = args.split("\\r?\\n");
                for(String s: argArr){
                        if("".equals(s.trim())) continue;
                        

Modified: trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Log.java
===================================================================
--- trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Log.java    
2015-08-05 10:32:57 UTC (rev 4812)
+++ trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Log.java    
2015-08-31 22:59:34 UTC (rev 4813)
@@ -13,10 +13,12 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTextArea;
 
+import org.ibex.util.Semaphore;
 import org.vexi.launcher.Launcher.Context;
 
 
 public class Log {
+       final Semaphore alive = new Semaphore();
        final Context context;
        private List<String> log = new ArrayList();
        private JTextArea text;
@@ -51,6 +53,7 @@
                log("[ERROR] "+msg); 
                if(context!=null) context.updateError(msg);
                if(text==null){
+                       alive.dec();
                        text = new JTextArea();
                text.setLineWrap(true);
                text.setWrapStyleWord(true);
@@ -74,7 +77,8 @@
                        
             frame.addWindowListener( new WindowAdapter() {
                 public void windowClosing(WindowEvent we) {
-                    context.exited();
+                       alive.release();
+                       context.exited();
                 }
             } );
                }       

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to