From c97a88d7b397923a062150d4e25a799c0f2851ed Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Wed, 23 Nov 2011 15:29:09 -0300 Subject: Fix BUG #1057 Signed-off-by: Paulo Alcantara Reviewer: Marcelo Lira Hugo Parente Lima --- libshiboken/gilstate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libshiboken/gilstate.cpp b/libshiboken/gilstate.cpp index cc8963ff7..cb682fa7e 100644 --- a/libshiboken/gilstate.cpp +++ b/libshiboken/gilstate.cpp @@ -26,8 +26,9 @@ namespace Shiboken { GilState::GilState() + : m_locked(false) { - if(Py_IsInitialized()) { + if (Py_IsInitialized()) { m_gstate = PyGILState_Ensure(); m_locked = true; } @@ -40,11 +41,11 @@ GilState::~GilState() void GilState::release() { - if(m_locked && Py_IsInitialized()) { + if (m_locked && Py_IsInitialized()) { PyGILState_Release(m_gstate); m_locked = false; } } -} // namespace Shiboken +} // namespace Shiboken -- cgit v1.2.3