diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-18 01:33:09 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-18 01:33:09 +0100 |
commit | b747a6690493191d3183bb865770e4bc7cbaf8b6 (patch) | |
tree | 8432a6fecebdafee00cd4a500df8746c17104a3e | |
parent | Ensure an AppInstance exists before processing options (diff) | |
download | project2-1.1.4.3.tar.bz2 project2-1.1.4.3.tar.xz project2-1.1.4.3.zip |
Don't start the daemon components until options have been processed and process has been calledproject2-1.1.4.3
-rw-r--r-- | project2/daemon/p2daemonAppEngine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/project2/daemon/p2daemonAppEngine.cpp b/project2/daemon/p2daemonAppEngine.cpp index b48b75b..f6fc178 100644 --- a/project2/daemon/p2daemonAppEngine.cpp +++ b/project2/daemon/p2daemonAppEngine.cpp @@ -53,9 +53,9 @@ END_OPTIONS(DaemonAppEngine); DaemonAppEngine::DaemonAppEngine(int argc, char ** argv) : main_loop(Glib::MainLoop::create()), - daemonFactory(boost::bind(&DaemonLoader::create, DaemonLoader::getFor(daemonType), argc, argv)) + daemonFactory(boost::bind(&DaemonLoader::create, + boost::bind(DaemonLoader::getFor, boost::cref(daemonType)), argc, argv)) { - Glib::signal_timeout().connect_seconds(sigc::mem_fun(this, &DaemonAppEngine::periodicCallback), periodicTimeout); } DaemonAppEngine::~DaemonAppEngine() @@ -96,8 +96,9 @@ DaemonAppEngine::process() IgnoreSignal(SIGUSR2); AddSignalHandler(SIGQUIT, boost::bind(&DaemonAppEngine::shutdown, this)); AddSignalHandler(SIGTERM, boost::bind(&DaemonAppEngine::shutdown, this)); - + Logger()->messagebf(LOG_DEBUG, "%s: Starting events.", __PRETTY_FUNCTION__); + Glib::signal_timeout().connect_seconds(sigc::mem_fun(this, &DaemonAppEngine::periodicCallback), periodicTimeout); evThread = new std::thread(&Glib::MainLoop::run, main_loop.operator->()); Logger()->messagebf(LOG_INFO, "%s: Starting daemon.", __PRETTY_FUNCTION__); daemon->run(); |