forked from premiere/premiere-libtorrent
catch exceptions out of the python notify callback and ignore them
This commit is contained in:
parent
dcb8b816a3
commit
acbe3c1880
|
@ -388,7 +388,7 @@ namespace
|
|||
}
|
||||
#endif // TORRENT_ABI_VERSION
|
||||
|
||||
void alert_notify(object cb)
|
||||
void alert_notify(object cb) try
|
||||
{
|
||||
lock_gil lock;
|
||||
if (cb)
|
||||
|
@ -396,6 +396,12 @@ namespace
|
|||
cb();
|
||||
}
|
||||
}
|
||||
catch (boost::python::error_already_set const&)
|
||||
{
|
||||
// this callback isn't supposed to throw an error.
|
||||
// just swallow and ignore the exception
|
||||
TORRENT_ASSERT_FAIL_VAL("python notify callback threw exception");
|
||||
}
|
||||
|
||||
void set_alert_notify(lt::session& s, object cb)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue