Closed GoogleCodeExporter closed 8 years ago
trying this with the examples I can't reproduce it. I would have expected at
least the make_torrent example to exercise the file_storage class.
Do you have a small example that can reproduce this?
Original comment by arvid.no...@gmail.com
on 10 Apr 2015 at 11:46
it seems like the default-generated copy constructor may be inlined and require
some access to internal_file_entry.
Original comment by arvid.no...@gmail.com
on 11 Apr 2015 at 12:06
could you try the patch r10956 to RC_1_0 and see if that fixes it?
Index: src/file_storage.cpp
===================================================================
--- src/file_storage.cpp (revision 10955)
+++ src/file_storage.cpp (revision 10956)
@@ -48,6 +48,39 @@
file_storage::~file_storage() {}
+ // even though this copy constructor and the copy assignment
+ // operator are identical to what the compiler would have
+ // generated, they are put here to explicitly make them part
+ // of libtorrent and properly exported by the .dll.
+ file_storage::file_storage(file_storage const& f)
+ : m_files(f.m_files)
+ , m_file_hashes(m_file_hashes)
+ , m_symlinks(m_symlinks)
+ , m_mtime(m_mtime)
+ , m_file_base(m_file_base)
+ , m_paths(m_paths)
+ , m_name(m_name)
+ , m_total_size(m_total_size)
+ , m_num_pieces(m_num_pieces)
+ , m_piece_length(m_piece_length)
+ {
+ }
+
+ file_storage& file_storage::operator=(file_storage const& f)
+ {
+ m_files = f.m_files;
+ m_file_hashes = m_file_hashes;
+ m_symlinks = m_symlinks;
+ m_mtime = m_mtime;
+ m_file_base = m_file_base;
+ m_paths = m_paths;
+ m_name = m_name;
+ m_total_size = m_total_size;
+ m_num_pieces = m_num_pieces;
+ m_piece_length = m_piece_length;
+ return *this;
+ }
+
void file_storage::reserve(int num_files)
{
m_files.reserve(num_files);
Index: include/libtorrent/file_storage.hpp
===================================================================
--- include/libtorrent/file_storage.hpp (revision 10955)
+++ include/libtorrent/file_storage.hpp (revision 10956)
@@ -237,6 +237,8 @@
file_storage();
// hidden
~file_storage();
+ file_storage(file_storage const& f);
+ file_storage& operator=(file_storage const&);
// returns true if the piece length has been initialized
// on the file_storage. This is typically taken as a proxy
Original comment by arvid.no...@gmail.com
on 11 Apr 2015 at 2:29
That patch is not correct. there are "f." missing in front of most of the
members that are supposed to be copied.
Original comment by arvid.no...@gmail.com
on 11 Apr 2015 at 5:37
Thanks. Fix works. RC_1_0 (10964) linked successfully.
Original comment by rominmai...@gmail.com
on 13 Apr 2015 at 9:47
Original comment by arvid.no...@gmail.com
on 13 Apr 2015 at 12:28
Original issue reported on code.google.com by
rominmai...@gmail.com
on 9 Apr 2015 at 9:50