From b22009f992124953e4e1fdd5b30750d04b803c15 Mon Sep 17 00:00:00 2001 From: iamanaws <78835633+Iamanaws@users.noreply.github.com> Date: Sat, 4 Jan 2025 08:34:54 -0800 Subject: [PATCH] DBusManager: Remove unnecessary locks from getters in singleton --- src/core/DBusManager.cpp | 5 ----- src/core/DBusManager.hpp | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/core/DBusManager.cpp b/src/core/DBusManager.cpp index b218ffd..34f573f 100644 --- a/src/core/DBusManager.cpp +++ b/src/core/DBusManager.cpp @@ -33,12 +33,10 @@ void DBusManager::initializeConnection() { } std::shared_ptr DBusManager::getConnection() { - std::lock_guard lock(m_mutex); return m_pConnection; } std::shared_ptr DBusManager::getLoginProxy() { - std::lock_guard lock(m_mutex); if (!m_pLoginProxy) initializeConnection(); @@ -46,7 +44,6 @@ std::shared_ptr DBusManager::getLoginProxy() { } std::shared_ptr DBusManager::getSessionProxy() { - std::lock_guard lock(m_mutex); if (!m_pSessionProxy) initializeConnection(); @@ -54,7 +51,6 @@ std::shared_ptr DBusManager::getSessionProxy() { } void DBusManager::setLockedHint(bool locked) { - std::lock_guard lock(m_mutex); if (!m_pSessionProxy) { Debug::log(WARN, "[DBusManager] Cannot set locked hint: Proxy is not initialized."); return; @@ -71,7 +67,6 @@ void DBusManager::setLockedHint(bool locked) { } void DBusManager::sendUnlockSignal() { - std::lock_guard lock(m_mutex); if (!m_pSessionProxy) { Debug::log(WARN, "[DBusManager] Unlock signal skipped: Proxy is not initialized."); return; diff --git a/src/core/DBusManager.hpp b/src/core/DBusManager.hpp index cf4b1fb..6641577 100644 --- a/src/core/DBusManager.hpp +++ b/src/core/DBusManager.hpp @@ -2,7 +2,6 @@ #include #include -#include #include class DBusManager { @@ -25,6 +24,4 @@ private: std::shared_ptr m_pConnection; std::shared_ptr m_pLoginProxy; std::shared_ptr m_pSessionProxy; - - std::mutex m_mutex; };