aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2017-01-24 17:31:56 +0100
committerGitHub <noreply@github.com>2017-01-24 17:31:56 +0100
commit7c29334dddc6411bab8e7337b83aff9a7c2da1c6 (patch)
treebf82892d6dce9d574f952dc6893c673422a1597c
parentcfe4281a5b43409fa18c7ff36ee469a43385e945 (diff)
parent9a859576689aec0382e954fc0f43af2f006fe33c (diff)
Merge pull request #11490 from notspiff/fix_context_menus
fixed: context menu manager mess with profiles
-rw-r--r--xbmc/ContextMenuManager.cpp6
-rw-r--r--xbmc/ContextMenuManager.h1
-rw-r--r--xbmc/windows/GUIWindowLoginScreen.cpp5
3 files changed, 12 insertions, 0 deletions
diff --git a/xbmc/ContextMenuManager.cpp b/xbmc/ContextMenuManager.cpp
index 43250596a6..e597309a33 100644
--- a/xbmc/ContextMenuManager.cpp
+++ b/xbmc/ContextMenuManager.cpp
@@ -45,7 +45,13 @@ CContextMenuManager::CContextMenuManager(CAddonMgr& addonMgr)
CContextMenuManager::~CContextMenuManager()
{
+ Deinit();
+}
+
+void CContextMenuManager::Deinit()
+{
m_addonMgr.Events().Unsubscribe(this);
+ m_items.clear();
}
CContextMenuManager& CContextMenuManager::GetInstance()
diff --git a/xbmc/ContextMenuManager.h b/xbmc/ContextMenuManager.h
index 1f4f896343..6e7d0f53e7 100644
--- a/xbmc/ContextMenuManager.h
+++ b/xbmc/ContextMenuManager.h
@@ -40,6 +40,7 @@ public:
static CContextMenuManager& GetInstance();
void Init();
+ void Deinit();
ContextMenuView GetItems(const CFileItem& item, const CContextMenuItem& root = MAIN) const;
diff --git a/xbmc/windows/GUIWindowLoginScreen.cpp b/xbmc/windows/GUIWindowLoginScreen.cpp
index 045f6dda53..f6f6574299 100644
--- a/xbmc/windows/GUIWindowLoginScreen.cpp
+++ b/xbmc/windows/GUIWindowLoginScreen.cpp
@@ -273,6 +273,8 @@ CFileItemPtr CGUIWindowLoginScreen::GetCurrentListItem(int offset)
void CGUIWindowLoginScreen::LoadProfile(unsigned int profile)
{
+ CServiceBroker::GetContextMenuManager().Deinit();
+
// stop service addons and give it some time before we start it again
ADDON::CAddonMgr::GetInstance().StopServices(true);
@@ -323,6 +325,9 @@ void CGUIWindowLoginScreen::LoadProfile(unsigned int profile)
JSONRPC::CJSONRPC::Initialize();
#endif
+ // Restart context menu manager
+ CServiceBroker::GetContextMenuManager().Init();
+
// restart PVR services
CServiceBroker::GetPVRManager().Reinit();