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

[vidalia-svn] r1314: If we didn't launch our own Tor, don't try to meddle in its (trunk/src/gui)



Author: edmanm
Date: 2006-10-08 01:11:22 -0400 (Sun, 08 Oct 2006)
New Revision: 1314

Modified:
   trunk/src/gui/mainwindow.cpp
Log:
If we didn't launch our own Tor, don't try to meddle in its affairs when we
exit.


Modified: trunk/src/gui/mainwindow.cpp
===================================================================
--- trunk/src/gui/mainwindow.cpp	2006-10-08 05:02:29 UTC (rev 1313)
+++ trunk/src/gui/mainwindow.cpp	2006-10-08 05:11:22 UTC (rev 1314)
@@ -141,20 +141,22 @@
 {
   static bool delayedShutdownStarted = false;
   
-  /* If we're running a server currently, ask if we want to do a delayed
-   * shutdown. If we do, then close Vidalia only when Tor stops. Otherwise,
-   * kill Tor and bail now. */
-  ServerSettings settings(_torControl);
-  if (_torControl->isConnected() && settings.isServerEnabled() 
-                                 && !delayedShutdownStarted) {
-    if (delayServerShutdown()) {
-      /* Close when Tor stops */
-      connect(_torControl, SIGNAL(stopped()), this, SLOT(close()));
-      delayedShutdownStarted = _torControl->signal(TorSignal::Shutdown);
-      return;
+  if (_torControl->isVidaliaRunningTor()) {
+    /* If we're running a server currently, ask if we want to do a delayed
+     * shutdown. If we do, then close Vidalia only when Tor stops. Otherwise,
+     * kill Tor and bail now. */
+    ServerSettings settings(_torControl);
+    if (_torControl->isConnected() && settings.isServerEnabled() 
+                                   && !delayedShutdownStarted) {
+      if (delayServerShutdown()) {
+        /* Close when Tor stops */
+        connect(_torControl, SIGNAL(stopped()), this, SLOT(close()));
+        delayedShutdownStarted = _torControl->signal(TorSignal::Shutdown);
+        return;
+      }
+      /* Otherwise, just hill Tor now. Really. Die. */ 
+      _torControl->signal(TorSignal::Halt);
     }
-    /* Otherwise, just hill Tor now. Really. Die. */ 
-    _torControl->signal(TorSignal::Halt);
   }
   
   /* Disconnect all of the TorControl object's signals */