Avoid a segfault when the owner of a callable went out of scope and got deleted (pya): null weak pointer happens

This commit is contained in:
Matthias Koefferlein 2020-06-15 01:28:49 +02:00
parent 3f1c3cf209
commit fc75bf72f8
1 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,10 @@ void SignalHandler::call (const gsi::MethodBase *meth, gsi::SerialArgs &args, gs
std::vector<PythonRef> callables;
callables.reserve (m_cbfuncs.size ());
for (std::vector<CallbackFunction>::const_iterator c = m_cbfuncs.begin (); c != m_cbfuncs.end (); ++c) {
callables.push_back (c->callable ());
PythonRef callable = c->callable ();
if (callable) {
callables.push_back (c->callable ());
}
}
PythonRef result;