浏览代码

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

Wei Tjong Yao 12 年之前
父节点
当前提交
4d66b554c3
共有 1 个文件被更改,包括 2 次插入2 次删除
  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();
         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;
         }
     }