[fix] a couple crashes on exit on windows.
authorJim Carroll <thecarrolls@jiminger.com>
Sat, 22 Dec 2012 19:55:21 +0000 (14:55 -0500)
committerJim Carroll <thecarrolls@jiminger.com>
Sat, 22 Dec 2012 19:55:34 +0000 (14:55 -0500)
xbmc/Application.cpp
xbmc/SystemGlobals.cpp
xbmc/settings/GUISettings.h

index 9fba20b..f2bafb3 100644 (file)
@@ -2076,7 +2076,9 @@ void CApplication::UnloadSkin(bool forReload /* = false */)
 
   g_infoManager.Clear();
 
-  g_SkinInfo.reset();
+//  The g_SkinInfo boost shared_ptr ought to be reset here
+// but there are too many places it's used without checking for NULL
+// and as a result a race condition on exit can cause a crash.
 }
 
 bool CApplication::LoadUserWindows()
index 7363ddd..3c2be26 100644 (file)
@@ -55,7 +55,6 @@
 #include "linux/RBP.h"
 #endif
 
-  CGUISettings       g_guiSettings;
   CSettings          g_settings;
 
   CXBMCRenderManager g_renderManager;
index a3b1eb8..a2893c0 100644 (file)
@@ -25,6 +25,7 @@
 #include "guilib/Resolution.h"
 #include "addons/IAddon.h"
 #include "utils/Observer.h"
+#include "utils/GlobalsHandling.h"
 
 class TiXmlNode;
 class TiXmlElement;
@@ -526,4 +527,5 @@ private:
   void LoadFromXML(TiXmlElement *pRootElement, mapIter &it, bool advanced = false);
 };
 
-extern CGUISettings g_guiSettings;
+XBMC_GLOBAL_REF(CGUISettings, g_guiSettings);
+#define g_guiSettings XBMC_GLOBAL_USE(CGUISettings)