diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-09-13 20:41:16 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-09-13 20:41:16 +0000 |
commit | d7d157abbc91b3a936821a3c17bf43459b43ce01 (patch) | |
tree | 66489db62ac0962ed16632c5372ea9e22ab8db8a | |
parent | 109c6a010c692791eaec0eb0e373daf269ba08d1 (diff) |
fixed: Plugins "return prematurely" due to race in WaitOnScriptResult. #10136
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@33743 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/FileSystem/PluginDirectory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xbmc/FileSystem/PluginDirectory.cpp b/xbmc/FileSystem/PluginDirectory.cpp index a92cc83fdc..f5039eb0d7 100644 --- a/xbmc/FileSystem/PluginDirectory.cpp +++ b/xbmc/FileSystem/PluginDirectory.cpp @@ -461,9 +461,12 @@ bool CPluginDirectory::WaitOnScriptResult(const CStdString &scriptPath, const CS #ifdef HAS_PYTHON if (!g_pythonParser.isRunning(g_pythonParser.getScriptId(scriptPath.c_str()))) #endif - { // nope - bail - CLog::Log(LOGDEBUG, " %s - plugin exited prematurely - terminating", __FUNCTION__); - m_success = false; + { // check whether we exited normally + if (WaitForSingleObject(m_fetchComplete, 0) == WAIT_TIMEOUT) + { // python didn't return correctly + CLog::Log(LOGDEBUG, " %s - plugin exited prematurely - terminating", __FUNCTION__); + m_success = false; + } break; } |