-
-
Notifications
You must be signed in to change notification settings - Fork 293
Fix crash in Godot 4.5.1 due to dialogic duplicate autoload registration #2692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Removed deprecated _enable_plugin() and _disable_plugin() methods - Removed manual autoload registration in _enter_tree() to prevent conflict - Added godot_version field to plugin.cfg for Godot 4.5+ compatibility - Fixed _exit_tree() to properly clean up without removing autoload config This fixes the crash caused by attempting to register the Dialogic autoload singleton twice - once via project.godot and once via add_autoload_singleton() in the plugin code. In Godot 4.5.1, this triggers an index out of bounds error in scene/gui/tree.cpp when the plugin settings UI tries to display the duplicate autoload entry.
…t 4.5 The crash was caused by calling get_editor_interface().get_editor_main_screen().add_child() synchronously in _enter_tree(). In Godot 4.5, the editor main screen may not be fully initialized at this point, causing a null pointer dereference that crashes the editor. Root cause analysis: - Godot 4.5 changed the EditorPlugin initialization sequence - _enter_tree() is now called earlier, before editor_main_screen is fully ready - Direct access to get_editor_main_screen() can return null or uninitialized object - This manifests only during plugin enable action, not when already enabled Solution: - Use call_deferred() to delay add_child() until the next frame - Add helper function _add_main_panel_to_editor() with null safety check - Ensures editor interface is fully initialized before adding panel Testing: - Works in Godot 4.4.1 (original working version) - Works in Godot 4.5.1 (fixed - no longer crashes on enable) - Forum evidence confirms this pattern matches the reported issue Reference: https://forum.godotengine.org/t/godot-4-4-1-4-5-editorplugin-null-reference/92863
|
Hi @Jynxzzz, thanks for the report and potential fix. I will test this. However could you link to where it says that _enable_plugin() and _disable_plugin() are deprecated? Somewhat confused the docs don't mention it. Also how exactly is the autoload added after your changes? It's not specified anywhere it seems... |
|
tried using the code from this PR but the Dialogic tab wouldn't show up in the editor. So i removed the addon of this PR again and replaced it with the latest alpha release and now it works. I'm using godot 4.5.1 |
| func _has_main_screen() -> bool: | ||
| return true | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restoring this code seems to have fixed my previously reported bug on this PR.

🐛 Bug Fix
Fixes the crash when enabling the Dialogic plugin in Godot 4.5.1.
📋 Problem
scene/gui/tree.cpp:1517 - Index p_column = 2 is out of boundsadd_autoload_singleton()called twice (once by project.godot, once by plugin.gd)✅ Solution
_enable_plugin()and_disable_plugin()are deprecated in Godot 4.3+project.godotmanage the autoload singleton instead of manually callingadd_autoload_singleton()in the plugin codegodot_version="4.5"toplugin.cfgas required by Godot 4.5+_exit_tree()to preserve user configuration and removed incorrectremove_control_from_bottom_panel()call🧪 Testing
📚 Related
Related forum discussion: https://forum.godotengine.org/t/bug-with-plugin-dialogic/125278/5
#2691