From 93ebb12c589269e2b8c7baa136eb35d068b4a77a Mon Sep 17 00:00:00 2001 From: iisaev Date: Sat, 24 Oct 2026 11:29:12 +0200 Subject: [PATCH] Root nodes join through ModRoot.AddDeferred, so a reload that unloads the mod first never hands Godot a freed node Co-Authored-By: Claude Opus 5.5 --- test_suites/ingame_play/src/InGamePlayTestInitializer.cs | 2 +- test_suites/novel_flow/src/NovelFlowTestInitializer.cs | 2 +- test_suites/windows/src/ToolWindowsTestInitializer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test_suites/ingame_play/src/InGamePlayTestInitializer.cs b/test_suites/ingame_play/src/InGamePlayTestInitializer.cs index 053a933..71bbb0a 100644 --- a/test_suites/ingame_play/src/InGamePlayTestInitializer.cs +++ b/test_suites/ingame_play/src/InGamePlayTestInitializer.cs @@ -25,7 +25,7 @@ namespace Cthangover.Tools.Tests.InGamePlay driverQueued = true; GameLogger.Log("TEST", "InGamePlayTestInitializer: activating in-game play-test test"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new InGamePlayTestDriverNode()); + ModRoot.AddDeferred(new InGamePlayTestDriverNode()); } } } diff --git a/test_suites/novel_flow/src/NovelFlowTestInitializer.cs b/test_suites/novel_flow/src/NovelFlowTestInitializer.cs index 47e70be..6f8b990 100644 --- a/test_suites/novel_flow/src/NovelFlowTestInitializer.cs +++ b/test_suites/novel_flow/src/NovelFlowTestInitializer.cs @@ -31,7 +31,7 @@ namespace Cthangover.Tools.Tests.NovelFlow .Select(a => a.Substring("--shots=".Length)) .FirstOrDefault(); GameLogger.Log("TEST", $"NovelFlowTestInitializer: activating novel_flow, shots={shots ?? "off"}"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new NovelFlowTestDriver(shots)); + ModRoot.AddDeferred(new NovelFlowTestDriver(shots)); } } } diff --git a/test_suites/windows/src/ToolWindowsTestInitializer.cs b/test_suites/windows/src/ToolWindowsTestInitializer.cs index 69af2e7..f0c9e04 100644 --- a/test_suites/windows/src/ToolWindowsTestInitializer.cs +++ b/test_suites/windows/src/ToolWindowsTestInitializer.cs @@ -37,7 +37,7 @@ namespace Cthangover.Tools.Tests.Windows driverQueued = true; GameLogger.Log("TEST", $"ToolWindowsTestInitializer: activating tool windows test, shots='{shots ?? ""}'"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new ToolWindowsTestDriverNode(shots)); + ModRoot.AddDeferred(new ToolWindowsTestDriverNode(shots)); } } }