Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
handling deadlock around using the dialog progress from python. fixes…
… 10303, fixes 12274, fixes 12581.
  • Loading branch information
Jim Carroll committed Mar 20, 2012
1 parent 7fad808 commit ed9cc6c
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions xbmc/interfaces/python/xbmcmodule/dialog.cpp
Expand Up @@ -469,18 +469,28 @@ namespace PYXBMC
return NULL;
}

PyXBMCGUILock();
CGUIDialogProgress* pDialog= (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (PyXBMCWindowIsNull(pDialog)) return NULL;
((DialogProgress*)self)->dlg = pDialog;
CGUIDialogProgress* pDialog;
{
CPyThreadState releaseGil;
CSingleLock glock(g_graphicsContext);

pDialog->SetHeading(utf8Line[0]);
pDialog= (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (!pDialog)
{
glock.Leave();
releaseGil.Restore();
PyErr_SetString(PyExc_SystemError, "Error: Window is NULL, this is not possible :-)");
return NULL;
}
((DialogProgress*)self)->dlg = pDialog;

for (int i = 1; i < 4; i++)
pDialog->SetLine(i - 1,utf8Line[i]);
pDialog->SetHeading(utf8Line[0]);

PyXBMCGUIUnlock();
pDialog->StartModal();
for (int i = 1; i < 4; i++)
pDialog->SetLine(i - 1,utf8Line[i]);

pDialog->StartModal();
}

Py_INCREF(Py_None);
return Py_None;
Expand Down

0 comments on commit ed9cc6c

Please sign in to comment.