Skip to content

Commit

Permalink
guilib: do not kill plugin script if we are waiting for user input
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jul 7, 2016
1 parent e318896 commit b91a79d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions xbmc/filesystem/PluginDirectory.cpp
Expand Up @@ -494,9 +494,23 @@ bool CPluginDirectory::WaitOnScriptResult(const std::string &scriptPath, int scr
else
{
// kill the script if it does not return within 30 seconds
if (!m_fetchComplete.WaitMSec(30000))
// and we are not waiting for user input
XbmcThreads::EndTime timer(30000);
while (CScriptInvocationManager::GetInstance().IsRunning(scriptId))
{
cancelled = true;
if (m_fetchComplete.WaitMSec(1000))
{
break;
}
if (g_windowManager.HasModalDialog( {DialogModalityType::MODAL }))
{
timer.Set(30000);
}
if (timer.IsTimePast())
{
cancelled = true;
break;
}
}
}

Expand Down

0 comments on commit b91a79d

Please sign in to comment.