X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreapplication.cpp;h=3d8b15967a4b7b1a80b05da40ca0b56da367cef7;hp=d92e46d9df30db2dcb1980e06bdae02fc54866f7;hb=10f9c27ee5d92ece2931947cd341c7f7b548f580;hpb=5c6804f291a63f978e328aeddcc8448e3443b45e diff --git a/src/core/coreapplication.cpp b/src/core/coreapplication.cpp index d92e46d9..3d8b1596 100644 --- a/src/core/coreapplication.cpp +++ b/src/core/coreapplication.cpp @@ -22,7 +22,11 @@ #include "core.h" -CoreApplicationInternal::CoreApplicationInternal() { +CoreApplicationInternal::CoreApplicationInternal() + : _coreCreated(false) +{ + Q_INIT_RESOURCE(sql); + // put core-only arguments here CliParser *parser = Quassel::cliParser(); parser->addOption("port",'p', tr("The port quasselcore will listen at"), QString("4242")); @@ -33,8 +37,10 @@ CoreApplicationInternal::CoreApplicationInternal() { } CoreApplicationInternal::~CoreApplicationInternal() { - Core::saveState(); - Core::destroy(); + if(_coreCreated) { + Core::saveState(); + Core::destroy(); + } } bool CoreApplicationInternal::init() { @@ -51,6 +57,7 @@ bool CoreApplicationInternal::init() { } Core::instance(); // create and init the core + _coreCreated = true; if(!Quassel::isOptionSet("norestore")) { Core::restoreState();