Skip to content

Commit

Permalink
bug 1754: add missing GIL lock in generated callback destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
cawka committed Aug 14, 2013
1 parent b4828ad commit a6857b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bindings/python/ns3modulegen_core_customizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ class %s : public ns3::CallbackImpl<%s>
}
virtual ~%s()
{
PyGILState_STATE __py_gil_state;
__py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
Py_DECREF(m_callback);
m_callback = NULL;
PyGILState_Release(__py_gil_state);
}
virtual bool IsEqual(ns3::Ptr<const ns3::CallbackImplBase> other_base) const
Expand Down

0 comments on commit a6857b4

Please sign in to comment.