From ae47ec4b2a5cbf801d31535af4415dea3a535d41 Mon Sep 17 00:00:00 2001 From: randomdan Date: Tue, 3 Apr 2012 18:43:12 +0000 Subject: Create app engine on the heap as SourceObjects are now self registering (smart pointered) --- project2/console/consoleAppEngine.h | 2 +- project2/console/p2consoleMain.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project2/console/consoleAppEngine.h b/project2/console/consoleAppEngine.h index 4368c6b..3bfd9ed 100644 --- a/project2/console/consoleAppEngine.h +++ b/project2/console/consoleAppEngine.h @@ -12,7 +12,7 @@ class ConsoleEnvironment; -class ConsoleApplicationEngine : public ApplicationEngine, TaskHost, ViewHost { +class ConsoleApplicationEngine : public ApplicationEngine, public TaskHost, public ViewHost { public: ConsoleApplicationEngine(const ConsoleEnvironment *, ScriptReaderPtr); virtual ~ConsoleApplicationEngine(); diff --git a/project2/console/p2consoleMain.cpp b/project2/console/p2consoleMain.cpp index 19b3f9d..9b3ceec 100644 --- a/project2/console/p2consoleMain.cpp +++ b/project2/console/p2consoleMain.cpp @@ -15,10 +15,10 @@ main(int argc, char ** argv) BOOST_FOREACH(const ConsoleEnvironment::ToDo & todo, env.todoList()) { LoaderBase::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1)); Logger()->messagef(LOG_DEBUG, "%s: Beginning script '%s/%s'", __FUNCTION__, todo.get<0>().c_str(), todo.get<1>().c_str()); - ConsoleApplicationEngine app(&env, env.resolveScript(todo.get<0>(), todo.get<1>(), false)); + boost::intrusive_ptr app(new ConsoleApplicationEngine(&env, env.resolveScript(todo.get<0>(), todo.get<1>(), false))); Logger()->messagef(LOG_DEBUG, "%s: Processing file", __FUNCTION__); - app.process(); + app->process(); Logger()->messagef(LOG_DEBUG, "%s: Complete", __FUNCTION__); LoaderBase::onAllComponents(boost::bind(&ComponentLoader::onIteration, _1)); -- cgit v1.2.3