Browse Source

Delete root widget before clearing wrapped map (which cleans up UIWidgets minus currently orphaned ones that end up in widgetWrap_)

Josh Engebretson 9 years ago
parent
commit
40717aae54
1 changed files with 1 additions and 3 deletions
  1. 1 3
      Source/Atomic/UI/UI.cpp

+ 1 - 3
Source/Atomic/UI/UI.cpp

@@ -141,10 +141,8 @@ UI::~UI()
         
         tb::TBWidgetsAnimationManager::Shutdown();
 
-        // The root widget can acquire a delegate if it is retrieved in script (via getting parent), clear it here
-        rootWidget_->SetDelegate(0);
-        widgetWrap_.Clear();    
         delete rootWidget_;
+        widgetWrap_.Clear();
         
         // leak
         //delete TBUIRenderer::renderer_;