Commit 154a9524 authored by Igor Kushnir's avatar Igor Kushnir Committed by Milian Wolff
Browse files

Don't call ItemRepository::close() twice in a row

ItemRepositoryRegistry::unRegisterRepository() is called only from
within ~ItemRepository(). ~ItemRepository() unconditionally calls
close() right after unRegisterRepository(). There is no need to lock the
repository's mutex in its destructor. So removing the duplicate close()
call along with the repository's mutex lock from unRegisterRepository()
must be safe.
parent 8d6f7237
......@@ -260,10 +260,6 @@ void ItemRepositoryRegistry::unRegisterRepository(AbstractItemRepository* reposi
QMutexLocker lock(&d->m_mutex);
Q_ASSERT(d->m_repositories.contains(repository));
{
std::scoped_lock repoLock(*repository);
repository->close();
}
d->m_repositories.remove(repository);
}
......
......@@ -47,7 +47,7 @@ public:
void registerRepository(AbstractItemRepository* repository, AbstractRepositoryManager* manager);
/// Remove a repository.
/// It will automatically be closed (if it was open).
/// @note Unregistering does not close @p repository.
void unRegisterRepository(AbstractItemRepository* repository);
/// @returns The path to item-repositories.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment