aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Morten Kvarving <cptspiff@gmail.com>2017-01-19 14:11:16 +0100
committerMartijn Kaijser <mcm.kaijser@gmail.com>2017-01-24 17:44:59 +0100
commit76680280f5469d8e546d88470951a86da7d1de7a (patch)
treed235ec30648a526cc55b3fad004a8e43096b67a9
parent21995b60d66c7c99cc072a384461d8393f584c75 (diff)
fixed: context menu manager mess with profiles
killed e.g. 'mark as watched'. ref http://forum.kodi.tv/showthread.php?tid=290858
-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 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();