Please sign in to comment.
Fixed crash of death when calling XBPyThread::stop() while inside a p…
…ython dialog's doModal() When XBPyThread::stop() is called, a SystemExit exception is raised in Python script's threads, but the Python window "misses the memo". It continues calling PyXBMC_MakePendingCalls() (), which XBMC continues populating with onAction events even though the event's thread has a SystemExit exception raised. Eventually, as python objects are unloaded, the user-supplied onAction() will throw an exception. When this is caught (), a call to PyErr_Print() seems to go on an object-freeing spree, but the deallocation of something naughty causes python26.dll (Win32) to invoke a "crash of death" immediately terminating the entire XBMC application. The fix is to have doModal() check if the exception has been raised; if so, hide the window and return control to the python script. By having XBPyThread::stop() invoke g_pythonParser.PulseGlobalEvent() we can force doModal() to wake up immediately instead of laying dormant until another onAction event.  https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/python/xbmcmodule/window.cpp#L540  https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/python/xbmcmodule/GUIPythonWindow.cpp#L281
- Loading branch information...
Showing with 12 additions and 0 deletions.