diff --git a/ChangeLog b/ChangeLog index 4deba2427..10c797932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,8 @@ * almost completely changed the storage interface (for custom storage) * added support for hashing pieces in multiple threads + * fixed bug when deleting files for magnet links before they had metadata + 1.0.7 release * fix bug where loading settings via load_state() would not trigger all diff --git a/simulation/libsimulator b/simulation/libsimulator index a6129b416..8417cbee7 160000 --- a/simulation/libsimulator +++ b/simulation/libsimulator @@ -1 +1 @@ -Subproject commit a6129b41688ae3caa667f0ac766080fbee28eb37 +Subproject commit 8417cbee7f1a813f032c5c1ed81e1f2881af7580 diff --git a/src/torrent.cpp b/src/torrent.cpp index d8f9d6caa..2a0492f34 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -8770,6 +8770,16 @@ namespace libtorrent return; } + // if we don't have metadata yet, we don't know anything about the file + // structure and we have to assume we don't have any file. Deleting files + // in this mode would cause us to (recursively) delete m_save_path, which + // is bad. + if (!valid_metadata()) + { + alerts().emplace_alert(get_handle(), m_torrent_file->info_hash()); + return; + } + // storage may be NULL during shutdown if (m_storage.get()) {