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);
|
bencode(std::back_inserter(out), session_state);
|
||||||
file f;
|
file f;
|
||||||
error_code ec;
|
error_code ec;
|
||||||
if (f.open(state_path.toLocal8Bit().data(), file::write_only, ec)) {
|
if (!f.open(state_path.toLocal8Bit().constData(), file::write_only, ec)) return;
|
||||||
if (ec) {
|
if (ec) return;
|
||||||
file::iovec_t b = {&out[0], out.size()};
|
file::iovec_t b = {&out[0], out.size()};
|
||||||
f.writev(0, &b, 1, ec);
|
f.writev(0, &b, 1, ec);
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
entry session_state = s->state();
|
entry session_state = s->state();
|
||||||
boost::filesystem::ofstream out(state_path.toLocal8Bit().constData()
|
boost::filesystem::ofstream out(state_path.toLocal8Bit().constData()
|
||||||
|
|||||||
Reference in New Issue
Block a user