Browse Source

Fixed exit crashes issue in Editor (manifested itself when 'Edit' menu has been popped up).

Wei Tjong Yao 12 years ago
parent
commit
4d66b554c3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Engine/UI/Menu.cpp

+ 2 - 2
Engine/UI/Menu.cpp

@@ -73,8 +73,8 @@ void Menu::Update(float timeStep)
         const Vector<SharedPtr<UIElement> >& children = popup_->GetChildren();
         const Vector<SharedPtr<UIElement> >& children = popup_->GetChildren();
         for (unsigned i = 0; i < children.Size(); ++i)
         for (unsigned i = 0; i < children.Size(); ++i)
         {
         {
-            Menu* menu = static_cast<Menu*>(children[i].Get());
-            if (!menu->autoPopup_ && !menu->IsHovering())
+            Menu* menu = dynamic_cast<Menu*>(children[i].Get());
+            if (menu && !menu->autoPopup_ && !menu->IsHovering())
                 menu->autoPopup_ = true;
                 menu->autoPopup_ = true;
         }
         }
     }
     }