diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | src/CommonAPI/DBus/DBusFactory.cpp | 4 | ||||
-rw-r--r-- | src/test/DBusConnectionTest.cpp | 6 |
3 files changed, 10 insertions, 3 deletions
@@ -1,6 +1,9 @@ Changes ======= +v3.1.10.3 +- Fixed crash on dlclose() + v3.1.10.2 - Fix of calling unregisterStub() sometimes freezes - Fix deadlock by changing 'std::mutex connectionGuard_' to 'std::recursive_mutex' in D-Bus connection diff --git a/src/CommonAPI/DBus/DBusFactory.cpp b/src/CommonAPI/DBus/DBusFactory.cpp index cde564e..64c39d4 100644 --- a/src/CommonAPI/DBus/DBusFactory.cpp +++ b/src/CommonAPI/DBus/DBusFactory.cpp @@ -21,6 +21,10 @@ INITIALIZER(FactoryInit) { Runtime::get()->registerFactory("dbus", Factory::get()); } +DEINITIALIZER(FactoryDeinit) { + Runtime::get()->unregisterFactory("dbus"); +} + std::shared_ptr<CommonAPI::DBus::Factory> Factory::get() { static std::shared_ptr<Factory> theFactory = std::make_shared<Factory>(); diff --git a/src/test/DBusConnectionTest.cpp b/src/test/DBusConnectionTest.cpp index 8882532..1e999f3 100644 --- a/src/test/DBusConnectionTest.cpp +++ b/src/test/DBusConnectionTest.cpp @@ -70,13 +70,13 @@ TEST_F(DBusConnectionTest, ConnectionStatusEventWorks) { while (expectedEventCount < 10) { ASSERT_TRUE(dbusConnection_->connect()); ASSERT_TRUE(dbusConnection_->isConnected()); - std::this_thread::sleep_for(std::chrono::microseconds(20000)); + std::this_thread::sleep_for(std::chrono::microseconds(40000)); ASSERT_EQ(connectionStatusEventCount, ++expectedEventCount); ASSERT_EQ(connectionStatus, CommonAPI::AvailabilityStatus::AVAILABLE); dbusConnection_->disconnect(); ASSERT_FALSE(dbusConnection_->isConnected()); - std::this_thread::sleep_for(std::chrono::microseconds(20000)); + std::this_thread::sleep_for(std::chrono::microseconds(40000)); ASSERT_EQ(connectionStatusEventCount, ++expectedEventCount); ASSERT_EQ(connectionStatus, CommonAPI::AvailabilityStatus::NOT_AVAILABLE); } @@ -142,7 +142,7 @@ TEST_F(DBusConnectionTest, SendingAsyncDBusMessagesWorks) { &CommonAPI::DBus::defaultCallInfo); for (int i = 0; i < 100; i++) { - std::this_thread::sleep_for(std::chrono::microseconds(10)); + std::this_thread::sleep_for(std::chrono::microseconds(1000)); } ASSERT_EQ(serviceHandlerDBusMessageCount, expectedDBusMessageCount); |