Skip to content

Instantly share code, notes, and snippets.

@asavah
Created October 29, 2020 01:30
Show Gist options
  • Save asavah/ecb200090a78df85d88b5c647655baf1 to your computer and use it in GitHub Desktop.
Save asavah/ecb200090a78df85d88b5c647655baf1 to your computer and use it in GitHub Desktop.
927-powermanager-initsgtagethree.patch
diff --git a/xbmc/ServiceManager.cpp b/xbmc/ServiceManager.cpp
index 5fae97bea3..ee53121127 100644
--- a/xbmc/ServiceManager.cpp
+++ b/xbmc/ServiceManager.cpp
@@ -138,9 +138,6 @@ bool CServiceManager::InitStageTwo(const CAppParamParser &params, const std::str
m_fileExtensionProvider.reset(new CFileExtensionProvider(*m_addonMgr));
- m_powerManager.reset(new CPowerManager());
- m_powerManager->Initialize();
- m_powerManager->SetDefaults();
m_weatherManager.reset(new CWeatherManager());
@@ -154,6 +151,10 @@ bool CServiceManager::InitStageTwo(const CAppParamParser &params, const std::str
// stage 3 is called after successful initialization of WindowManager
bool CServiceManager::InitStageThree(const std::shared_ptr<CProfileManager>& profileManager)
{
+ m_powerManager.reset(new CPowerManager());
+ m_powerManager->Initialize();
+ m_powerManager->SetDefaults();
+
// Peripherals depends on strings being loaded before stage 3
m_peripherals->Initialise();
@@ -183,6 +184,7 @@ void CServiceManager::DeinitStageThree()
m_contextMenuManager->Deinit();
m_gameServices.reset();
m_peripherals->Clear();
+ m_powerManager.reset();
}
void CServiceManager::DeinitStageTwo()
@@ -190,7 +192,6 @@ void CServiceManager::DeinitStageTwo()
init_level = 1;
m_weatherManager.reset();
- m_powerManager.reset();
m_fileExtensionProvider.reset();
m_gameRenderManager.reset();
m_peripherals.reset();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment