Skip to content

Commit

Permalink
Fix BUG #1057
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Alcantara <[email protected]>
Reviewer: Marcelo Lira <[email protected]>
          Hugo Parente Lima <[email protected]>
  • Loading branch information
Paulo Alcantara committed Nov 23, 2011
1 parent 76eeb63 commit 9f110f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libshiboken/gilstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ namespace Shiboken
{

GilState::GilState()
: m_locked(false)
{
if(Py_IsInitialized()) {
if (Py_IsInitialized()) {
m_gstate = PyGILState_Ensure();
m_locked = true;
}
Expand All @@ -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

0 comments on commit 9f110f8

Please sign in to comment.