X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fserver%2FTorrentSession.cpp;fp=src%2Fserver%2FTorrentSession.cpp;h=1065a6e9b4a0c54d41ad2920b6b663cc8a5d0040;hp=b877470236d24f1f42d660b796e8fc22117921d3;hb=5e2c71d43ef7d91dbde62ee5a507e570d7619d1b;hpb=e27002978511dc6be46ebb3ea35851a17bf19e93 diff --git a/src/server/TorrentSession.cpp b/src/server/TorrentSession.cpp index b877470..1065a6e 100644 --- a/src/server/TorrentSession.cpp +++ b/src/server/TorrentSession.cpp @@ -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(); }