aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/dialogs/GUIDialogMediaSource.cpp6
-rw-r--r--xbmc/messaging/ApplicationMessenger.cpp11
2 files changed, 12 insertions, 5 deletions
diff --git a/xbmc/dialogs/GUIDialogMediaSource.cpp b/xbmc/dialogs/GUIDialogMediaSource.cpp
index e4ccc8fdb3..86fae93704 100644
--- a/xbmc/dialogs/GUIDialogMediaSource.cpp
+++ b/xbmc/dialogs/GUIDialogMediaSource.cpp
@@ -417,12 +417,12 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
void CGUIDialogMediaSource::OnPath(int item)
{
- if (item < 0 || item > m_paths->Size()) return;
+ if (item < 0 || item >= m_paths->Size()) return;
- if (m_name != CUtil::GetTitleFromPath(m_paths->Get(item)->GetPath()))
+ std::string path(m_paths->Get(item)->GetPath());
+ if (m_name != CUtil::GetTitleFromPath(path))
m_bNameChanged = true;
- std::string path(m_paths->Get(item)->GetPath());
CGUIKeyboardFactory::ShowAndGetInput(path, CVariant{ g_localizeStrings.Get(1021) }, false);
m_paths->Get(item)->SetPath(path);
diff --git a/xbmc/messaging/ApplicationMessenger.cpp b/xbmc/messaging/ApplicationMessenger.cpp
index d0f60aede3..96c7bb9bed 100644
--- a/xbmc/messaging/ApplicationMessenger.cpp
+++ b/xbmc/messaging/ApplicationMessenger.cpp
@@ -136,8 +136,15 @@ int CApplicationMessenger::SendMsg(ThreadMessage&& message, bool wait)
// waitEvent ... just for such contingencies :)
{
// ensure the thread doesn't hold the graphics lock
- CSingleExit exit(CServiceBroker::GetWinSystem()->GetGfxContext());
- waitEvent->Wait();
+ CWinSystemBase* winSystem = CServiceBroker::GetWinSystem();
+ //! @todo This won't really help as winSystem can die every single
+ // moment on shutdown. A shared ptr would be a more valid solution
+ // depending on the design dependencies.
+ if (winSystem)
+ {
+ CSingleExit exit(winSystem->GetGfxContext());
+ waitEvent->Wait();
+ }
return *result;
}