From ac5b21e4c35df0ae389a02a0a434e24d1bbbf48f Mon Sep 17 00:00:00 2001 From: iisaev Date: Sat, 24 Oct 2026 11:29:19 +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/edit/src/RpgEditorTestInitializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suites/edit/src/RpgEditorTestInitializer.cs b/test_suites/edit/src/RpgEditorTestInitializer.cs index c4e2223..7b54174 100644 --- a/test_suites/edit/src/RpgEditorTestInitializer.cs +++ b/test_suites/edit/src/RpgEditorTestInitializer.cs @@ -27,7 +27,7 @@ namespace Cthangover.Tools.RpgEditor.Tests .Select(a => a.Substring("--shots=".Length)) .FirstOrDefault(); GameLogger.Log("TEST", $"RpgEditorTestInitializer: activating rpg_editor_edit, shots={shots ?? "off"}"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new RpgEditorTestDriver(shots)); + ModRoot.AddDeferred(new RpgEditorTestDriver(shots)); } } }