X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.cpp;h=35caf13be27eef07c065e252a16b97219d5e8421;hp=c29d1ff78b588e0c7154253f80b9382ca3090ec5;hb=7c9c1b348382b8b77f96a883945c522d32a478d5;hpb=453ccab6ade4a21c7aa3c331af893c91468250a4 diff --git a/src/core/sessionthread.cpp b/src/core/sessionthread.cpp index c29d1ff7..35caf13b 100644 --- a/src/core/sessionthread.cpp +++ b/src/core/sessionthread.cpp @@ -36,12 +36,9 @@ SessionThread::SessionThread(UserId uid, bool restoreState, QObject *parent) } SessionThread::~SessionThread() { - if(_session) { - _session->setParent(0); - _session->moveToThread(thread()); - _session->deleteLater(); - _session = 0; - } + // shut down thread gracefully + quit(); + wait(); } CoreSession *SessionThread::session() { @@ -106,13 +103,5 @@ void SessionThread::run() { emit initialized(); exec(); delete _session; - _session = 0; } -void SessionThread::stopSession() { - if(_session) { - connect(_session, SIGNAL(destroyed()), this, SLOT(quit())); - _session->deleteLater(); - _session = 0; - } -}