summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/ThreadedLoader.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 18:58:24 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 18:58:24 +0000
commit602e31074b30167baace71ccfff1f58a6b3f0626 (patch)
treeeb7b85c99532af48adfe6322e2b620ac31c62f76 /src/libs/gui/ThreadedLoader.cpp
parent0e47cf5e7153a96875a64754291fad1cdbf26da7 (diff)
downloadingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.gz
ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.bz2
ingen-602e31074b30167baace71ccfff1f58a6b3f0626.zip
More serialization work.
Preliminary copy/paste (nodes only) git-svn-id: http://svn.drobilla.net/lad/ingen@1418 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/ThreadedLoader.cpp')
-rw-r--r--src/libs/gui/ThreadedLoader.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp
index d85d54a3..88dd4b1a 100644
--- a/src/libs/gui/ThreadedLoader.cpp
+++ b/src/libs/gui/ThreadedLoader.cpp
@@ -36,8 +36,18 @@ ThreadedLoader::ThreadedLoader(SharedPtr<EngineInterface> engine)
{
set_name("Loader");
- // FIXME: rework this so the thread is only present when it's doing something (save mem)
- // and module isn't loaded until required
+ if (parser())
+ start();
+ else
+ cerr << "WARNING: Failed to load ingen_serialisation module, load disabled." << endl;
+}
+
+
+SharedPtr<Parser>
+ThreadedLoader::parser()
+{
+ if (_parser)
+ return _parser;
World* world = App::instance().world();
if (!world->serialisation_module)
@@ -53,15 +63,7 @@ ThreadedLoader::ThreadedLoader(SharedPtr<EngineInterface> engine)
_parser = SharedPtr<Parser>(new_parser());
}
- if (_parser)
- start();
- else
- cerr << "WARNING: Failed to load ingen_serialisation module, load disabled." << endl;
-}
-
-
-ThreadedLoader::~ThreadedLoader()
-{
+ return _parser;
}