From 492458676bf9dc0d6f046f31dce95c5f1103d419 Mon Sep 17 00:00:00 2001 From: ametovic Date: Wed, 27 Oct 2010 21:19:29 +0000 Subject: [PATCH] fixed: deadlock in python Dialog_Numeric function, Thx Anssi git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35043 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 --- xbmc/lib/libPython/xbmcmodule/dialog.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/xbmc/lib/libPython/xbmcmodule/dialog.cpp b/xbmc/lib/libPython/xbmcmodule/dialog.cpp index c244105c9..c03e55ee5 100644 --- a/xbmc/lib/libPython/xbmcmodule/dialog.cpp +++ b/xbmc/lib/libPython/xbmcmodule/dialog.cpp @@ -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 { @@ -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 { @@ -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; @@ -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;