[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [vidalia/alpha] Fix deadlock when browser process does not launch



commit a24d398fb0d21745880f4f001bdb5cb9f23dc1e0
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Wed Mar 21 20:46:10 2012 -0300

    Fix deadlock when browser process does not launch
---
 src/vidalia/HelperProcess.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/vidalia/HelperProcess.cpp b/src/vidalia/HelperProcess.cpp
index 28cce18..19a3286 100644
--- a/src/vidalia/HelperProcess.cpp
+++ b/src/vidalia/HelperProcess.cpp
@@ -138,13 +138,18 @@ void
 HelperProcess::toForeground()
 {
 #if defined(Q_WS_MAC)
+  if(state() != QProcess::Running)
+    return;
+
   ProcessSerialNumber psn;
   OSStatus st;
 
   do {
     st = GetProcessForPID(pid(), &psn);
-  } while(st == -600);
+    QCoreApplication::processEvents();
+  } while(st == procNotFound and state() == QProcess::Running);
 
-  SetFrontProcess(&psn);
+  if(st != procNotFound)
+    SetFrontProcess(&psn);
 #endif
 }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits