diff options
author | renatofilho <renato.filho@openbossa.org> | 2010-10-26 15:38:21 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:08:53 -0300 |
commit | ce8f43df969038f5e24c7923abeac2c9fa6461e0 (patch) | |
tree | d116562943ec0d5a4c69856aac7eb19ed15e61ec /libshiboken/gilstate.cpp | |
parent | 467240696e7ed0ca03cdecffa2b63112ab9507d8 (diff) |
Release gil before call C++ function on virtual method.
Fixes bug #423.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libshiboken/gilstate.cpp')
-rw-r--r-- | libshiboken/gilstate.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libshiboken/gilstate.cpp b/libshiboken/gilstate.cpp index 50a3c6e6e..f49930e1d 100644 --- a/libshiboken/gilstate.cpp +++ b/libshiboken/gilstate.cpp @@ -33,10 +33,14 @@ GilState::GilState() GilState::~GilState() { - if(Py_IsInitialized()) - PyGILState_Release(m_gstate); + release(); } +void GilState::release() +{ + if(Py_IsInitialized() && m_gstate) + PyGILState_Release(m_gstate); +} } // namespace Shiboken |