mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-11 04:17:28 -04:00
Fixed deadlock in Library::writeBookmarksToFile()
This commit is contained in:
1 parent
fa8d0f8e07
commit
e1db9164c8
2 files changed
+3
-6
No files matched your search
+2
-5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user