summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/CommonAPI/Runtime.hpp2
-rw-r--r--src/CommonAPI/Runtime.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/include/CommonAPI/Runtime.hpp b/include/CommonAPI/Runtime.hpp
index 49c5030..9672fe7 100644
--- a/include/CommonAPI/Runtime.hpp
+++ b/include/CommonAPI/Runtime.hpp
@@ -185,6 +185,8 @@ private:
std::mutex factoriesMutex_;
std::mutex loadMutex_;
+ static std::shared_ptr<Runtime> theRuntime__;
+
friend class ProxyManager;
};
diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp
index 9a6cb4f..6e19f07 100644
--- a/src/CommonAPI/Runtime.cpp
+++ b/src/CommonAPI/Runtime.cpp
@@ -27,9 +27,10 @@ const char *COMMONAPI_DEFAULT_FOLDER = "/usr/local/lib/commonapi";
const char *COMMONAPI_DEFAULT_CONFIG_FILE = "commonapi.ini";
const char *COMMONAPI_DEFAULT_CONFIG_FOLDER = "/etc";
+std::shared_ptr<Runtime> Runtime::theRuntime__ = std::make_shared<Runtime>();
+
std::shared_ptr<Runtime> Runtime::get() {
- static std::shared_ptr<Runtime> theRuntime = std::make_shared<Runtime>();
- return theRuntime;
+ return theRuntime__;
}
Runtime::Runtime()