Skip to content
Browse files

CGUIWindow: resolve includes on copy of xml element to avoid manipula…

…tion of stored xml element
  • Loading branch information...
1 parent 833d84d commit 3daf23d66bba7b87cbff031656fe1bad2e7f9c4c @pieh pieh committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 xbmc/guilib/GUIWindow.cpp
5 xbmc/guilib/GUIWindow.cpp
@@ -159,6 +159,10 @@ bool CGUIWindow::Load(TiXmlElement* pRootElement)
return false;
+ // we must create copy of root element as we will manipulate it when resolving includes
+ // and we don't want original root element to change
+ pRootElement = (TiXmlElement*)pRootElement->Clone();
// set the scaling resolution so that any control creation or initialisation can
// be done with respect to the correct aspect ratio
g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
@@ -260,6 +264,7 @@ bool CGUIWindow::Load(TiXmlElement* pRootElement)
m_windowLoaded = true;
+ delete pRootElement;
return true;

0 comments on commit 3daf23d

Please sign in to comment.
Something went wrong with that request. Please try again.