浏览代码

don't remove the button region if it's state was inactive, it won't have
been there

Cary Sandvig 25 年之前
父节点
当前提交
47f03acb20
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      panda/src/gui/guiButton.cxx

+ 3 - 1
panda/src/gui/guiButton.cxx

@@ -477,7 +477,9 @@ void GuiButton::manage(GuiManager* mgr, EventHandler& eh, Node* n) {
 
 void GuiButton::unmanage(void) {
   if (_mgr != (GuiManager*)0L)
-    _mgr->remove_region(_rgn);
+    if ((_state != NONE) && (_state != INACTIVE) &&
+	(_state != INACTIVE_ROLLOVER))
+      _mgr->remove_region(_rgn);
   if (_behavior_running)
     this->stop_behavior();
   switch_state(NONE);