| | 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. */ |
| | 72 | void |
| | 73 | MainWindow::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(); |