diff options
author | Martijn Kaijser <martijn@xbmc.org> | 2017-01-24 20:12:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 20:12:21 +0100 |
commit | 1521bbee3c36224f35b859b72d94d194c37432fb (patch) | |
tree | d235ec30648a526cc55b3fad004a8e43096b67a9 | |
parent | 21995b60d66c7c99cc072a384461d8393f584c75 (diff) | |
parent | 76680280f5469d8e546d88470951a86da7d1de7a (diff) |
Merge pull request #11534 from MartijnKaijser/contextmenu
fixed: context menu manager mess with profiles
-rw-r--r-- | xbmc/ContextMenuManager.cpp | 6 | ||||
-rw-r--r-- | xbmc/ContextMenuManager.h | 1 | ||||
-rw-r--r-- | xbmc/windows/GUIWindowLoginScreen.cpp | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/xbmc/ContextMenuManager.cpp b/xbmc/ContextMenuManager.cpp index 4329c542d3..92688728be 100644 --- a/xbmc/ContextMenuManager.cpp +++ b/xbmc/ContextMenuManager.cpp @@ -43,7 +43,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 3a96b8a765..7f613b1687 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 5efb4b2052..63fb648c49 100644 --- a/xbmc/windows/GUIWindowLoginScreen.cpp +++ b/xbmc/windows/GUIWindowLoginScreen.cpp @@ -272,6 +272,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); @@ -322,6 +324,9 @@ void CGUIWindowLoginScreen::LoadProfile(unsigned int profile) JSONRPC::CJSONRPC::Initialize(); #endif + // Restart context menu manager + CServiceBroker::GetContextMenuManager().Init(); + // restart PVR services CServiceBroker::GetPVRManager().Reinit(); |