Skip to content

EditorPlugins are being added to the editor during hot reload, not afterwards #1132

Open
@brezhnevtusks

Description

@brezhnevtusks

I have a main screen plugin with a window that has an exported OnEditor field referencing a Godot Resource. Whenever I reload the code in a project, errors are logged that have to do with that field. In one of the projects, those errors happen along with an editor crash (I wasn't able to establish why it crashed, though, only that both the error and the crash are caused by the same field).

The error looks like this (this is from the attached minimal project):

ERROR: /home/brezhnevtusks/.cargo/git/checkouts/gdext-067f4b88e7bd088f/0289637/godot-core/src/private.rs:455 - godot-rust function call failed: MainScreenPluginWindow::set_test_resource()
ERROR:  Reason: parameter #0 (core::option::Option<godot_core::obj::gd::Gd<on_editor_crash::main_screen_plugin::test_resource::TestResource>>) conversion
ERROR:  Source: cannot convert to class TestResource: Gd { id: -9223370132640683675, class: Resource }

Setting reloadable to false in the .gdextension file fixes the issue, so I assume it has to do with how hot reloading is handled for editor plugins? Or maybe my setup is wrong in some aspect that leads to those errors?

Attached is a minimal Godot project where I am able to consistently reproduce the issue. Just build, make changes to code while the Godot editor is open and you should see errors in the Output.

I am on Ubuntu 24.04.2 LTS, using Godot v4.4.1.stable.official [49a5bc7b6] and latest godot-rust master.

OnEditorCrash.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugc: registerRegister classes, functions and other symbols to GDScript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions