Skip to content
This repository
Browse code

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

…tion of stored xml element
  • Loading branch information...
commit 3daf23d66bba7b87cbff031656fe1bad2e7f9c4c 1 parent 833d84d
Michal Piechowiak authored December 02, 2012

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  xbmc/guilib/GUIWindow.cpp
5  xbmc/guilib/GUIWindow.cpp
@@ -159,6 +159,10 @@ bool CGUIWindow::Load(TiXmlElement* pRootElement)
159 159
     return false;
160 160
   }
161 161
 
  162
+  // we must create copy of root element as we will manipulate it when resolving includes
  163
+  // and we don't want original root element to change
  164
+  pRootElement = (TiXmlElement*)pRootElement->Clone();
  165
+
162 166
   // set the scaling resolution so that any control creation or initialisation can
163 167
   // be done with respect to the correct aspect ratio
164 168
   g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
@@ -260,6 +264,7 @@ bool CGUIWindow::Load(TiXmlElement* pRootElement)
260 264
 
261 265
   m_windowLoaded = true;
262 266
   OnWindowLoaded();
  267
+  delete pRootElement;
263 268
   return true;
264 269
 }
265 270
 

0 notes on commit 3daf23d

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