-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Unloading plugin results into crash on macOS
and Linux
at Godot exit
#92727
Comments
macOS
at Godot exitmacOS
and Linux
at Godot exit
After consulting on the issue, it appears that the problem lies with the plugin cleanup logic, not an engine bug. The plugin attempts to remove a node from the tree and free control in The entire cleanup logic should be moved to If you think something else should be done feel free to comment and I can reopen the issue. Thanks! |
@coppolaemilio That not work because |
Why are you trying to free it? There's no reason to free any of the plugin nodes from |
From the plugin documentation, it is recommended. And if I'm not freeing the resource, the Editor closes with a lot of memory leaks. |
For custom resources yes, but it should not be necessary for nodes. I guess if it's documented like this we probably shouldn't add an extra step to unload all plugins before quitting the editor. I'll take another look. |
From the example, this is a scene added to a dock, and I guessing it is a Control Node.
Yes, thanks please check this |
I can't reproduce any leaks when node removal is missing (at least with MRP).
Opened PR that should fix it - #93238, will fully test it tomorrow. |
One more interesting part is why using |
updateI was able to fix now my segmentation faults and memory leaks at exit, it works for Windows and macOS, Linux needs still to be tested. |
# Why The plugin has some issues to release resources at Godot exit and result sometimes in a segmentation fault under Linux # What - fix `remove_child` on `free_instance` to be called deferred now - removed the temporary `free_fix` workaround - fix orphan nodes in `GdUnitTestDiscoverer` - introduce a new flag to call deferred on `free_instance` at plugin exit # Godot bug related godotengine/godot#92727
Tested versions
v4.2.2.stable.official [15073af] macOS
System information
macOS Sonoma 14.1.1
Issue description
My plugin is crashing at Godot exit on macOS and Linux, it works without any issues on Windows and Linux systems.
There is an issue when using
free
at__exit_tree
inside theEditorPlugin
, usingqueue_free
helps but ends up with a lot of orphan resources at exit, so I prefer to usefree
.Using
queue_free
with afterwardawait get_tree().process_frame
do also crash in my plugin.Steps to reproduce
Use the attached example project (a strictly reduced version of my plugin, includes only the inspector)
sometimes the Godot editor is hangs and needs manually to kill, sometimes it ends with signal 11
Minimal reproduction project (MRP)
plugin_free.zip
The text was updated successfully, but these errors were encountered: