forked from premiere/premiere-libtorrent
[#1217] Fix RuntimeWarning registering pointer with Python
This fix checks for existing registered pointers for alert so that Boost does not output the following warning when importing libtorrent in Python: > RuntimeWarning: to-Python converter for boost::shared_ptrlibtorrent::alert already registered; second conversion method ignored.
This commit is contained in:
parent
febcbbf17c
commit
de499310f5
|
@ -170,9 +170,11 @@ void bind_alert()
|
|||
using boost::noncopyable;
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
typedef boost::shared_ptr<alert> alert_holder;
|
||||
#if BOOST_VERSION >= 106000
|
||||
|
||||
if (boost::python::converter::registry::query(
|
||||
boost::python::type_id <boost::shared_ptr<alert> >()) == NULL) {
|
||||
register_ptr_to_python<boost::shared_ptr<alert> >();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
typedef alert alert_holder;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue