mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Fix crash on Startup with libtorrent v0.15
This commit is contained in:
@@ -1379,12 +1379,10 @@ void Bittorrent::saveSessionState() {
|
||||
bencode(std::back_inserter(out), session_state);
|
||||
file f;
|
||||
error_code ec;
|
||||
if (f.open(state_path.toLocal8Bit().data(), file::write_only, ec)) {
|
||||
if (ec) {
|
||||
if (!f.open(state_path.toLocal8Bit().constData(), file::write_only, ec)) return;
|
||||
if (ec) return;
|
||||
file::iovec_t b = {&out[0], out.size()};
|
||||
f.writev(0, &b, 1, ec);
|
||||
}
|
||||
}
|
||||
#else
|
||||
entry session_state = s->state();
|
||||
boost::filesystem::ofstream out(state_path.toLocal8Bit().constData()
|
||||
|
||||
Reference in New Issue
Block a user