Skip to content

Commit

Permalink
Other check for null pointer before calling decref
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed May 23, 2016
1 parent a1e826e commit 9b2be7a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/python/qgspythonutilsimpl.cpp
Expand Up @@ -580,11 +580,13 @@ bool QgsPythonUtilsImpl::evalString( const QString& command, QString& result )
bool success = nullptr != res;

// TODO: error handling
if ( res )
{
if ( success )
result = PyObjectToQString( res );

if ( success )
result = PyObjectToQString( res );

Py_XDECREF( res );
Py_XDECREF( res );
}

// we are done calling python API, release global interpreter lock
PyGILState_Release( gstate );
Expand Down

0 comments on commit 9b2be7a

Please sign in to comment.