diff --git a/src/libclient/CMakeLists.txt b/src/libclient/CMakeLists.txt index d4acf7d1f9978d714d67ede435c06303c64ccbbc..50f21b3468b01be98cd6fe8855475e0ff6ce04d2 100644 --- a/src/libclient/CMakeLists.txt +++ b/src/libclient/CMakeLists.txt @@ -176,24 +176,6 @@ if(NOT (${ENABLE_PLUGIN} MATCHES false)) add_definitions(-DENABLE_PLUGIN=true) endif() -set(CHK_FREEABLE_BEFORE_ERASE_ACCOUNT_DESCRIPTION - "Check that an account has been marked freeable by the client -before freeing the structures. This avoids various race conditions -conditions while removing accounts but may not be supported by all -clients. ON by default on GNU/Linux systems, otherwise OFF.") - -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - option(CHK_FREEABLE_BEFORE_ERASE_ACCOUNT - CHK_FREEABLE_BEFORE_ERASE_ACCOUNT_DESCRIPTION ON) -else() - option(CHK_FREEABLE_BEFORE_ERASE_ACCOUNT - CHK_FREEABLE_BEFORE_ERASE_ACCOUNT_DESCRIPTION OFF) -endif() - -if(CHK_FREEABLE_BEFORE_ERASE_ACCOUNT) - add_definitions(-DCHK_FREEABLE_BEFORE_ERASE_ACCOUNT) -endif() - include_directories(SYSTEM ${QT_INCLUDES}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/libclient/api/account.h b/src/libclient/api/account.h index f9c38d0aa4be67ec26325e38867257200dbf5077..958bd53475780520ac6a98870fddd3f30755fa2b 100644 --- a/src/libclient/api/account.h +++ b/src/libclient/api/account.h @@ -217,7 +217,6 @@ Q_ENUM_NS(LookupStatus) struct Info { - bool freeable = false; bool valid = true; QString registeredName; Status status = account::Status::INVALID; diff --git a/src/libclient/api/newaccountmodel.h b/src/libclient/api/newaccountmodel.h index 743130d2b126b837b02fd43cba10136732bc3dcc..9e336cf74a0b3bf8f65d0277c646ca13f4d1973a 100644 --- a/src/libclient/api/newaccountmodel.h +++ b/src/libclient/api/newaccountmodel.h @@ -67,10 +67,6 @@ public: * @return a const account::Info& structure. */ const account::Info& getAccountInfo(const QString& accountId) const; - /** - * flag account corresponding to passed id as freeable. - */ - void flagFreeable(const QString& accountId) const; /** * Used when images < 20 Mb are automatically accepted and downloaded diff --git a/src/libclient/newaccountmodel.cpp b/src/libclient/newaccountmodel.cpp index 871f0c7c9b778d75171a75afae63dcf13339b0f9..f88bb89b5c2b62d52abc72f878f916da8a4203bd 100644 --- a/src/libclient/newaccountmodel.cpp +++ b/src/libclient/newaccountmodel.cpp @@ -77,9 +77,6 @@ public: AccountInfoDbMap accounts; // Synchronization tools - std::mutex m_mutex_account; - std::mutex m_mutex_account_removal; - std::condition_variable m_condVar_account_removal; std::atomic_bool username_changed; QString new_username; @@ -343,21 +340,6 @@ NewAccountModel::changeAccountPassword(const QString& accountId, newPassword); } -void -NewAccountModel::flagFreeable(const QString& accountId) const -{ - auto account = pimpl_->accounts.find(accountId); - if (account == pimpl_->accounts.end()) - throw std::out_of_range("NewAccountModel::flagFreeable, can't find " - + accountId.toStdString()); - - { - std::lock_guard<std::mutex> lock(pimpl_->m_mutex_account_removal); - account->second.first.freeable = true; - } - pimpl_->m_condVar_account_removal.notify_all(); -} - const account::Info& NewAccountModel::getAccountInfo(const QString& accountId) const { @@ -790,13 +772,6 @@ NewAccountModelPimpl::removeFromAccounts(const QString& accountId) accountInfo.valid = false; Q_EMIT linked.accountRemoved(accountId); -#ifdef CHK_FREEABLE_BEFORE_ERASE_ACCOUNT - std::unique_lock<std::mutex> lock(m_mutex_account_removal); - // Wait for client to stop using old account structs - m_condVar_account_removal.wait(lock, [&]() { return accounts[accountId].first.freeable; }); - lock.unlock(); -#endif - // Now we can free them accounts.erase(accountId); } @@ -1228,7 +1203,6 @@ NewAccountModel::avatar(const QString& accountId) const return authority::storage::avatar(accountId); } - } // namespace lrc #include "api/moc_newaccountmodel.cpp"