[tor-commits] [vidalia/alpha] Fix deadlock when browser process does not launch
chiiph at torproject.org
chiiph at torproject.org
Wed Mar 21 23:49:46 UTC 2012
commit a24d398fb0d21745880f4f001bdb5cb9f23dc1e0
Author: Tomás Touceda <chiiph at torproject.org>
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
}
More information about the tor-commits
mailing list