- Added daemon start functionality
[qtrapids] / src / server / TorrentSession.cpp
index b877470..1065a6e 100644 (file)
@@ -38,6 +38,15 @@ TorrentSession::TorrentSession(QObject *parent, QSettings *settings)
        
 }
 
+
+TorrentSession::~TorrentSession()
+{
+       alertWaiter_->stop();
+       alertWaiter_->wait();
+       emit sessionTerminated();
+}
+
+
 void TorrentSession::loadState()
 {
        TorrentDownloadInfo info;
@@ -251,6 +260,7 @@ qtrapids::ParamsMap_t TorrentSession::getOptions()
 void TorrentSession::terminateSession()
 {
        qDebug() << "Terminate called";
+       // Emiting terminate() here causes the server application to quit in main()
        emit terminate();
 }