[arch-dev-public] archlinux-torrent-utils
Thomas Bächler
thomas at archlinux.org
Sun May 31 16:05:44 EDT 2009
Pierre Schmitz schrieb:
> The only problem is that both programs segfault on exit. I am a real noob on
> C++; so I am in need of a little help here. Everything works fine and my very
> limited skills show me that the problem occours after the main() method was
> left.
The bt::TorrentCreator class uses some ressources that are local in the
main procedure - if those are already destroyed when the destructor is
called, that might cause the segfault.
Try to replace
bt::TorrentCreator tc(target, trackers, webseeds, chunk_size, name,
comment, priv, decentralized);
with
bt::TorrentCreator *tc = new bt::TorrentCreator(target, trackers,
webseeds, chunk_size, name, comment, priv, decentralized);
Then replace every occurrence of tc.foo with tc->foo and add
delete tc;
before the every return command. If I am right, the segfault should be gone.
Another problem: The ktorrent torrent libraries are linked against all
kinds of stuff which is not needed - probably because KDE is not
compiled with -Wl,--as-needed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://www.archlinux.org/pipermail/arch-dev-public/attachments/20090531/d3d6d30d/attachment.pgp>
More information about the arch-dev-public
mailing list