Files
skelly/scenes/ui/DebugMenu.gd
Vladimir nett00n Budylnikov 742e4251fb Fix critical memory leaks, race conditions, and improve code quality
- Fix memory leaks in match3_gameplay.gd with proper queue_free() usage
  - Add comprehensive error handling and fallback mechanisms to SettingsManager
  - Resolve scene loading race conditions in GameManager with state protection
  - Remove problematic static variables from tile.gd, replace with instance-based approach
  - Consolidate duplicate debug menu classes into shared DebugMenuBase
  - Add input validation across all user input paths for security and stability
2025-09-25 00:47:08 +04:00

30 lines
847 B
GDScript

extends DebugMenuBase
func _find_target_scene():
# Fixed: Search more thoroughly for match3 scene
if match3_scene:
# Already found, stop searching
_stop_search_timer()
return
# Search in current scene tree
var current_scene = get_tree().current_scene
if current_scene:
# Try to find match3 by script path first
match3_scene = _find_node_by_script(current_scene, target_script_path)
# Fallback: search by common node names
if not match3_scene:
for possible_name in ["Match3", "match3", "Match3Game"]:
match3_scene = current_scene.find_child(possible_name, true, false)
if match3_scene:
break
if match3_scene:
DebugManager.log_debug("Found match3 scene: " + match3_scene.name, log_category)
_update_ui_from_scene()
_stop_search_timer()
else:
# Continue searching if not found
_start_search_timer()