forked from premiere/premiere-libtorrent
make hash_value work on expired torrent_handles
This commit is contained in:
parent
85cda6cf53
commit
816f405a15
|
@ -988,7 +988,9 @@ namespace libtorrent
|
||||||
|
|
||||||
std::size_t hash_value(torrent_handle const& th)
|
std::size_t hash_value(torrent_handle const& th)
|
||||||
{
|
{
|
||||||
return std::size_t(th.m_torrent.lock().get());
|
// using the locked shared_ptr value as hash doesn't work
|
||||||
|
// for expired weak_ptrs. So, we're left with a hack
|
||||||
|
return std::size_t(*reinterpret_cast<void* const*>(&th.m_torrent));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue