diff options
author | ksooo <3226626+ksooo@users.noreply.github.com> | 2023-09-24 19:16:07 +0200 |
---|---|---|
committer | ksooo <3226626+ksooo@users.noreply.github.com> | 2023-09-30 08:05:32 +0200 |
commit | 19cd0ab1c3acdf9dfd48ec81e622c78263a13321 (patch) | |
tree | 60584edf7d168e3fab43a56e4696dfa1b61806c0 | |
parent | 76791377070ba7a515277e72c6cecbd162d66523 (diff) |
[windows] Fix CGUIMediaWindow::WaitGetDirectoryItems to leave 'wait for update job finished loop' also if the update was canceled via CGUIMediaWindow::CancelUpdateItems.
-rw-r--r-- | xbmc/windows/GUIMediaWindow.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index e1e39245be..b55cb17754 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -2269,6 +2269,7 @@ bool CGUIMediaWindow::WaitGetDirectoryItems(CGetDirectoryItems &items) else { m_updateJobActive = true; + m_updateAborted = false; m_updateEvent.Reset(); CServiceBroker::GetJobManager()->Submit( [&]() { @@ -2277,14 +2278,21 @@ bool CGUIMediaWindow::WaitGetDirectoryItems(CGetDirectoryItems &items) }, nullptr, CJob::PRIORITY_NORMAL); - while (!m_updateEvent.Wait(1ms)) + // Loop until either the job ended or update canceled via CGUIMediaWindow::CancelUpdateItems. + while (!m_updateAborted && !m_updateEvent.Wait(1ms)) { if (!ProcessRenderLoop(false)) break; } - if (m_updateAborted || !items.m_result) + if (m_updateAborted) { + CLog::LogF(LOGDEBUG, "Get directory items job was canceled."); + ret = false; + } + else if (!items.m_result) + { + CLog::LogF(LOGDEBUG, "Get directory items job was unsuccessful."); ret = false; } } |