summaryrefslogtreecommitdiff
path: root/src/CommonAPI/Runtime.cpp
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-06-24 14:30:28 +0200
committerPhilip Rauwolf <rauwolf@itestra.de>2013-06-24 14:30:28 +0200
commite85fa0d2bd06ded7ee460e818994817aca80d2ef (patch)
tree3a663adfd3bdeb8128fd5eb03c14206f51c696cd /src/CommonAPI/Runtime.cpp
parent74b90aeece8cc8dd7f6e3fb275851e80b8754d7e (diff)
downloadgenivi-common-api-runtime-e85fa0d2bd06ded7ee460e818994817aca80d2ef.tar.gz
Added check on the mainloop context being initialized before used
Diffstat (limited to 'src/CommonAPI/Runtime.cpp')
-rw-r--r--src/CommonAPI/Runtime.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp
index d7185df..f930db9 100644
--- a/src/CommonAPI/Runtime.cpp
+++ b/src/CommonAPI/Runtime.cpp
@@ -57,5 +57,14 @@ std::shared_ptr<MainLoopContext> Runtime::getNewMainLoopContext() const {
return std::make_shared<MainLoopContext>();
}
+std::shared_ptr<Factory> Runtime::createFactory(std::shared_ptr<MainLoopContext> mainLoopContext,
+ const std::string factoryName,
+ const bool nullOnInvalidName) {
+ if(mainLoopContext && !mainLoopContext->isInitialized()) {
+ return std::shared_ptr<Factory>(NULL);
+ }
+ return doCreateFactory(mainLoopContext, factoryName, nullOnInvalidName);
+}
+
} // namespace CommonAPI