From 758d5f4a30bf4eb9c2ee41506c5177911e2bb87e Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 28 Jan 2015 05:03:34 +0000 Subject: [PATCH] merged changes from RC_1_0 --- ChangeLog | 1 + bindings/python/src/torrent_handle.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b569bafc1..a513e6f7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,7 @@ * almost completely changed the storage interface (for custom storage) * added support for hashing pieces in multiple threads + * fix bug in python binding for file_progress on torrents with no metadata * fix assert when removing a connected web seed * fix bug in tracker timeout logic * switch UPnP post back to HTTP 1.1 diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index a0c4ae107..710fb154c 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -83,8 +83,12 @@ list file_progress(torrent_handle& handle, int flags) { allow_threading_guard guard; - p.reserve(handle.torrent_file()->num_files()); - handle.file_progress(p, flags); + boost::intrusive_ptr ti = handle.torrent_file(); + if (ti) + { + p.reserve(ti->num_files()); + handle.file_progress(p, flags); + } } list result;