Changeset 3633

Show
Ignore:
Timestamp:
03/20/07 07:16:55 (2 years ago)
Author:
timothy
Message:

The calls in callScriptFunctionNamed should acquire the python GIL lock. With this change, Colloquy no longer get a SIGBUS when calling some Python functions. Patch by Nall. #1029

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plug-Ins/Python Support/JVPythonChatPlugin.m

    r3499 r3633  
    264264        if( ! _scriptModule ) return nil; 
    265265 
     266    PyGILState_STATE state; 
     267         
    266268        PyObject *dict = PyModule_GetDict( _scriptModule ); 
    267269        if( ! dict ) return nil; 
     
    282284                } 
    283285 
     286                state = PyGILState_Ensure(); 
    284287                PyObject *ret = PyObject_CallObject( func, args ); 
    285288 
     
    289292                Py_XDECREF( ret ); 
    290293                Py_DECREF( args ); 
    291  
     294                 
    292295                [self reportErrorIfNeededInFunction:functionName]; 
     296 
     297                PyGILState_Release(state); 
    293298 
    294299                return realRet;