added assert in torrent::state_updated() to make sure it's not called from the constructor

This commit is contained in:
Arvid Norberg 2012-03-01 23:18:32 +00:00
parent 8d754b9674
commit 1bd4d1633c
1 changed files with 6 additions and 0 deletions

View File

@ -8096,6 +8096,12 @@ namespace libtorrent
void torrent::state_updated()
{
// if this fails, this function is probably called
// from within the torrent constructor, which it
// shouldn't be. Whichever function ends up calling
// this should probably be moved to torrent::start()
TORRENT_ASSERT(shared_from_this());
// we're either not subscribing to this torrent, or
// it has already been updated this round, no need to
// add it to the list twice