Yet Another Deadlock fix. closes 12580
authorJim Carroll <thecarrolls@jiminger.com>
Wed, 21 Mar 2012 10:29:47 +0000 (06:29 -0400)
committerJim Carroll <thecarrolls@jiminger.com>
Wed, 21 Mar 2012 10:30:34 +0000 (06:30 -0400)
xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp

index d19b32c..ced6bc9 100644 (file)
@@ -609,11 +609,15 @@ namespace PYXBMC
     char *cLine = NULL;
     if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL;
 
-    PyXBMCGUILock();
-    int id = g_windowManager.GetTopMostModalDialogID();
-    if (id == WINDOW_INVALID) id = g_windowManager.GetActiveWindow();
-    bool ret = g_infoManager.EvaluateBool(cLine,id);
-    PyXBMCGUIUnlock();
+    bool ret;
+    {
+      CPyThreadState gilRelease;
+      CSingleLock gc(g_graphicsContext);
+
+      int id = g_windowManager.GetTopMostModalDialogID();
+      if (id == WINDOW_INVALID) id = g_windowManager.GetActiveWindow();
+      ret = g_infoManager.EvaluateBool(cLine,id);
+    }
 
     return Py_BuildValue((char*)"b", ret);
   }