From: Manuel Nickschas Date: Mon, 22 Sep 2008 15:40:12 +0000 (+0200) Subject: Don't start a core in CoreApplication's dtor... fixes BR #322 X-Git-Tag: 0.3.1~260 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=0f4d21d538c8cb4c8fb12cd285c4d7556714c2f3;hp=98f12cf014e5ef0b2f3827fb0b1e48931618d33c Don't start a core in CoreApplication's dtor... fixes BR #322 --- diff --git a/src/core/coreapplication.cpp b/src/core/coreapplication.cpp index d92e46d9..7098ab89 100644 --- a/src/core/coreapplication.cpp +++ b/src/core/coreapplication.cpp @@ -22,7 +22,9 @@ #include "core.h" -CoreApplicationInternal::CoreApplicationInternal() { +CoreApplicationInternal::CoreApplicationInternal() + : _coreCreated(false) +{ // put core-only arguments here CliParser *parser = Quassel::cliParser(); parser->addOption("port",'p', tr("The port quasselcore will listen at"), QString("4242")); @@ -33,8 +35,10 @@ CoreApplicationInternal::CoreApplicationInternal() { } CoreApplicationInternal::~CoreApplicationInternal() { - Core::saveState(); - Core::destroy(); + if(_coreCreated) { + Core::saveState(); + Core::destroy(); + } } bool CoreApplicationInternal::init() { @@ -51,6 +55,7 @@ bool CoreApplicationInternal::init() { } Core::instance(); // create and init the core + _coreCreated = true; if(!Quassel::isOptionSet("norestore")) { Core::restoreState(); diff --git a/src/core/coreapplication.h b/src/core/coreapplication.h index 14eec295..07fa5821 100644 --- a/src/core/coreapplication.h +++ b/src/core/coreapplication.h @@ -36,6 +36,9 @@ class CoreApplicationInternal { ~CoreApplicationInternal(); bool init(); + + private: + bool _coreCreated; }; class CoreApplication : public QCoreApplication, public Quassel {