Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
fixed: deadlock in python Dialog_Numeric function, Thx Anssi
Browse files Browse the repository at this point in the history
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35043 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
ametovic committed Oct 27, 2010
1 parent daee0e5 commit 4924586
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions xbmc/lib/libPython/xbmcmodule/dialog.cpp
Expand Up @@ -239,7 +239,11 @@ namespace PYXBMC
timedate.wMonth = atoi(sDefault.Mid(3,4));
timedate.wYear = atoi(sDefault.Right(4));
}
if (CGUIDialogNumeric::ShowAndGetDate(timedate, utf8Heading))
bool gotDate;
Py_BEGIN_ALLOW_THREADS
gotDate = CGUIDialogNumeric::ShowAndGetDate(timedate, utf8Heading);
Py_END_ALLOW_THREADS
if (gotDate)
value.Format("%2d/%2d/%4d", timedate.wDay, timedate.wMonth, timedate.wYear);
else
{
Expand All @@ -255,7 +259,11 @@ namespace PYXBMC
timedate.wHour = atoi(sDefault.Left(2));
timedate.wMinute = atoi(sDefault.Right(2));
}
if (CGUIDialogNumeric::ShowAndGetTime(timedate, utf8Heading))
bool gotTime;
Py_BEGIN_ALLOW_THREADS
gotTime = CGUIDialogNumeric::ShowAndGetTime(timedate, utf8Heading);
Py_END_ALLOW_THREADS
if (gotTime)
value.Format("%2d:%02d", timedate.wHour, timedate.wMinute);
else
{
Expand All @@ -266,7 +274,11 @@ namespace PYXBMC
else if (inputtype == 3)
{
value = cDefault;
if (!CGUIDialogNumeric::ShowAndGetIPAddress(value, utf8Heading))
bool gotIPAddress;
Py_BEGIN_ALLOW_THREADS
gotIPAddress = CGUIDialogNumeric::ShowAndGetIPAddress(value, utf8Heading);
Py_END_ALLOW_THREADS
if (!gotIPAddress)
{
Py_INCREF(Py_None);
return Py_None;
Expand All @@ -275,7 +287,11 @@ namespace PYXBMC
else
{
value = cDefault;
if (!CGUIDialogNumeric::ShowAndGetNumber(value, utf8Heading))
bool gotNumber;
Py_BEGIN_ALLOW_THREADS
gotNumber = CGUIDialogNumeric::ShowAndGetNumber(value, utf8Heading);
Py_END_ALLOW_THREADS
if (!gotNumber)
{
Py_INCREF(Py_None);
return Py_None;
Expand Down

0 comments on commit 4924586

Please sign in to comment.