summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-06-17 22:02:34 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-17 22:02:34 +0100
commitd5bd243f40428937199c0ce9baa857d3f07dfd90 (patch)
treece023e342289f37c4b969f5e19253a2aaee0280f
parentFix off by one error in rowstack (diff)
downloadproject2-1.1.4.2.tar.bz2
project2-1.1.4.2.tar.xz
project2-1.1.4.2.zip
Ensure an AppInstance exists before processing optionsproject2-1.1.4.2
-rw-r--r--project2/console/p2consoleMain.cpp3
-rw-r--r--project2/daemon/p2daemonMain.cpp7
2 files changed, 5 insertions, 5 deletions
diff --git a/project2/console/p2consoleMain.cpp b/project2/console/p2consoleMain.cpp
index 31ffe70..62f09b0 100644
--- a/project2/console/p2consoleMain.cpp
+++ b/project2/console/p2consoleMain.cpp
@@ -8,9 +8,10 @@ main(int argc, char ** argv)
{
OptionsSources::Add("", new CommandLineArguments(argc, argv, &ConsoleApplicationEngine::appendScript));
Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1));
- OptionsSource::loadSources([] { return ConsoleApplicationEngine::reqPlatform;} );
ConsoleApplicationEngine app;
+ OptionsSource::loadSources([] { return ConsoleApplicationEngine::reqPlatform;} );
+
app.process();
Plugable::onAllComponents(boost::bind(&ComponentLoader::onPeriodic, _1));
diff --git a/project2/daemon/p2daemonMain.cpp b/project2/daemon/p2daemonMain.cpp
index 8feada2..95de88e 100644
--- a/project2/daemon/p2daemonMain.cpp
+++ b/project2/daemon/p2daemonMain.cpp
@@ -47,16 +47,15 @@ main(int argc, char ** argv)
Plugable::onAllComponents(boost::bind(&ComponentLoader::onBegin, _1));
OptionsSources::Add("_2", new CommandLineArguments(argc, argv,
[](const char * a) { throw UnsupportedArguments(a); }));
+
+ DaemonAppEngine dae(argc, argv);
OptionsSource::loadSources([] { return DaemonAppEngine::reqPlatform;} );
- //Plugable::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1));
-
+
if (DaemonAppEngine::daemonize) {
daemonize();
}
- DaemonAppEngine dae(argc, argv);
dae.process();
- //Plugable::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1));
Plugable::onAllComponents(boost::bind(&ComponentLoader::onIdle, _1));
}