Fixed deadlock in Library::writeBookmarksToFile()

This commit is contained in:
Veloman Yunkan committed 2021-12-05 20:31:21 +04:00
1 parent fa8d0f8e07
commit e1db9164c8
2 files changed
+3 -6

No files matched your search

+2 -5
View File
@@ -274,11 +274,8 @@ bool Library::writeToFile(const std::string& path) const
bool Library::writeBookmarksToFile(const std::string& path) const
{
LibXMLDumper dumper(this);
std::string xml;
{
std::lock_guard<std::mutex> lock(m_mutex);
xml = dumper.dumpLibXMLBookmark();
};
// NOTE: LibXMLDumper::dumpLibXMLBookmark uses Library in a thread-safe way
const std::string xml = dumper.dumpLibXMLBookmark();
return writeTextFile(path, xml);
}