diff options
author | Philip Rauwolf <rauwolf@itestra.de> | 2013-06-24 14:30:28 +0200 |
---|---|---|
committer | Philip Rauwolf <rauwolf@itestra.de> | 2013-06-24 14:30:28 +0200 |
commit | e85fa0d2bd06ded7ee460e818994817aca80d2ef (patch) | |
tree | 3a663adfd3bdeb8128fd5eb03c14206f51c696cd /src/CommonAPI/Runtime.cpp | |
parent | 74b90aeece8cc8dd7f6e3fb275851e80b8754d7e (diff) | |
download | genivi-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.cpp | 9 |
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 |