Changeset 91

Show
Ignore:
Timestamp:
01/15/06 18:05:42 (3 years ago)
Author:
edmanm
Message:

Vidalia will close Tor gracefully when the application exits.

Location:
trunk/src/gui
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/mainwindow.cpp

    r90 r91  
    6565    delete _torControl; 
    6666  } 
     67} 
     68 
     69/** Called when the application is closing, by selecting "Exit" from the tray 
     70 * menu. This function disconnects the control socket and ends the Tor 
     71 * process. */ 
     72void 
     73MainWindow::close() 
     74{ 
     75  /* Disconnect all of the TorControl object's signals */ 
     76  disconnect(_torControl, 0, 0, 0); 
     77 
     78  /* Close the control socket */ 
     79  if (_torControl->isConnected()) { 
     80    _torControl->disconnect(); 
     81  } 
     82 
     83  /* Stop the Tor process */ 
     84  if (_torControl->isRunning()) { 
     85    _torControl->stop(); 
     86  } 
     87 
     88  /* And then quit for real */ 
     89  QMainWindow::close(); 
    6790} 
    6891 
  • trunk/src/gui/mainwindow.h

    r86 r91  
    4646  void stopped(int errorCode, QProcess::ExitStatus exitStatus); 
    4747  void about(); 
     48  void close(); 
    4849 
    4950private: