diff options
Diffstat (limited to 'src/CommonAPI/DBus/DBusFactory.cpp')
-rw-r--r-- | src/CommonAPI/DBus/DBusFactory.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/CommonAPI/DBus/DBusFactory.cpp b/src/CommonAPI/DBus/DBusFactory.cpp index 31a44c4..99f7e8e 100644 --- a/src/CommonAPI/DBus/DBusFactory.cpp +++ b/src/CommonAPI/DBus/DBusFactory.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -17,19 +17,19 @@ namespace CommonAPI { namespace DBus { -static std::weak_ptr<CommonAPI::Runtime> runtime__; - INITIALIZER(FactoryInit) { - runtime__ = Runtime::get(); - Runtime::get()->registerFactory("dbus", Factory::get()); + Factory::runtime_ = Runtime::get(); + Factory::runtime_.lock()->registerFactory("dbus", Factory::get()); } DEINITIALIZER(FactoryDeinit) { - if (auto rt = runtime__.lock()) { + if (auto rt = Factory::runtime_.lock()) { rt->unregisterFactory("dbus"); } } +std::weak_ptr<CommonAPI::Runtime> Factory::runtime_; + std::shared_ptr<CommonAPI::DBus::Factory> Factory::get() { static std::shared_ptr<Factory> theFactory = std::make_shared<Factory>(); @@ -44,7 +44,7 @@ Factory::~Factory() { void Factory::init() { -#ifndef WIN32 +#ifndef _WIN32 std::lock_guard<std::mutex> itsLock(initializerMutex_); #endif if (!isInitialized_) { @@ -56,7 +56,7 @@ Factory::init() { void Factory::registerInterface(InterfaceInitFunction _function) { -#ifndef WIN32 +#ifndef _WIN32 std::lock_guard<std::mutex> itsLock(initializerMutex_); #endif if (isInitialized_) { |