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

[tor-commits] [vidalia/alpha] Fix destructor problem in ControlConnection and TorControl



commit e7fffd73a98c589b8ef3ea374b8834e8864091b2
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Fri Mar 16 13:19:51 2012 -0300

    Fix destructor problem in ControlConnection and TorControl
---
 src/torcontrol/ControlConnection.cpp |    6 +++---
 src/torcontrol/TorControl.cpp        |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/torcontrol/ControlConnection.cpp b/src/torcontrol/ControlConnection.cpp
index af3d2d3..389a6e3 100644
--- a/src/torcontrol/ControlConnection.cpp
+++ b/src/torcontrol/ControlConnection.cpp
@@ -34,6 +34,7 @@ ControlConnection::ControlConnection(ControlMethod::Method method, TorEvents *ev
   _events = events;
   _status = Unset;
   _sock = 0;
+  _connectTimer = 0;
   _sendWaiter = new SendCommandEvent::SendWaiter();
   _method = method;
   _connected = false;
@@ -44,9 +45,8 @@ ControlConnection::~ControlConnection()
 {
   /* Clean up after the send waiter */
   delete _sendWaiter;
-  delete _sock;
-  delete _connectTimer;
-  _sock = 0;
+  if(_sock) delete _sock;
+  if(_connectTimer) delete _connectTimer;
 }
 
 /** Connect to the specified Tor control interface. */
diff --git a/src/torcontrol/TorControl.cpp b/src/torcontrol/TorControl.cpp
index 0ad9db6..6f08e26 100644
--- a/src/torcontrol/TorControl.cpp
+++ b/src/torcontrol/TorControl.cpp
@@ -107,7 +107,7 @@ TorControl::~TorControl()
   if (isVidaliaRunningTor()) {
     stop();
   }
-  _controlConn->disconnect();
+  disconnect();
   delete _controlConn;
 }
 



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