X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsessionthread.cpp;h=d178c2bb81de4f36b3a7172dc694353170de4e8d;hp=d5070955485dbbf7247f363dda731571f9365c4f;hb=4b600109a862705eaf44e59ca7bddb56b0663732;hpb=d1b6499b0b848d4287efae89107576548533502c diff --git a/src/core/sessionthread.cpp b/src/core/sessionthread.cpp index d5070955..d178c2bb 100644 --- a/src/core/sessionthread.cpp +++ b/src/core/sessionthread.cpp @@ -24,18 +24,18 @@ #include "coresession.h" -SessionThread::SessionThread(UserId uid, QObject *parent) : QThread(parent) { +SessionThread::SessionThread(UserId uid, bool restoreState, QObject *parent) : QThread(parent) { _user = uid; _session = 0; _sessionInitialized = false; + _restoreState = restoreState, connect(this, SIGNAL(initialized()), this, SLOT(setSessionInitialized())); } SessionThread::~SessionThread() { - // FIXME + // shut down thread gracefully quit(); wait(); - if(session()) _session->deleteLater(); } CoreSession *SessionThread::session() { @@ -76,8 +76,9 @@ void SessionThread::addClientToSession(QIODevice *socket) { } void SessionThread::run() { - _session = new CoreSession(user()); + _session = new CoreSession(user(), _restoreState); emit initialized(); exec(); + delete _session; }