Skip to content

Commit 95e9a83

Browse files
committed
Shifter: Build Log: Fix recursion when display hooks installed twice
Guard against double-install of display hooks. If the build log window was reopened without a clean close, the second install captured the already-hooked functions as originals, causing infinite recursion. Also reorder Guide Template Manager in shifter menu.
1 parent c9286ed commit 95e9a83

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

release/scripts/mgear/shifter/build_log/ui.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,12 @@ def _install_display_hooks(handler):
794794
global _original_display_warning
795795
global _original_display_error
796796

797+
# Guard against double-install: if already hooked, the globals hold
798+
# the real originals — capturing again would store the hooked
799+
# versions, causing infinite recursion when they call themselves.
800+
if _original_display_info is not None:
801+
return
802+
797803
import mgear.pymaya as pm
798804
from mgear.pymaya import cmd as pm_cmd
799805

release/scripts/mgear/shifter/menu.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ def install():
77
"""Install Shifter submenu"""
88
commands = (
99
("Guide Manager", str_show_guide_manager, "mgear_list.svg"),
10+
(
11+
"Guide Template Manager",
12+
str_template_manager,
13+
"mgear_users.svg",
14+
),
1015
(None, guide_utils_submenu),
1116
("-----", None),
1217
(None, game_submenu),
@@ -45,11 +50,6 @@ def install():
4550
"mgear_download.svg",
4651
),
4752
("-----", None),
48-
(
49-
"Guide Template Manager",
50-
str_template_manager,
51-
"mgear_users.svg",
52-
),
5353
(
5454
"Match Guide to Selected Joint Hierarchy",
5555
str_matchGuide,

0 commit comments

Comments
 (0)