Open Zylann opened 5 years ago
I've stumbled upon very similar experience in https://github.com/godotengine/godot/issues/6784#issuecomment-480588033.
Hehe
prints("Predelete", self, self.a)
Output: Predelete [Object:null] 42
No idea what happens, but it's still valid in d711c57d7
Still valid in 16524d4
Still valid in v3.4
Still reproducible in 4.0 RC 1.
Still reproducible in 4.2-dev (0606ba7c50ab7606c9db81a2c73162008ca683a6), and it's crashing:
Predelete 42
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.dev.custom_build (c97e4a31ac85839dea31d84a86c9441b7e775273)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x36980) [0x7f98954ef980] (??:0)
[2] EncodedObjectAsID::get_object_id() const (/home/akien/Projects/godot/godot.git/./core/io/marshalls.cpp:52)
[3] EditorDebuggerInspector::add_stack_variable(Array const&) (/home/akien/Projects/godot/godot.git/./editor/debugger/editor_debugger_inspector.cpp:236 (discriminator 2))
[4] ScriptEditorDebugger::_parse_message(String const&, unsigned long, Array const&) (/home/akien/Projects/godot/godot.git/./editor/debugger/script_editor_debugger.cpp:466)
[5] ScriptEditorDebugger::_notification(int) (/home/akien/Projects/godot/godot.git/./editor/debugger/script_editor_debugger.cpp:939 (discriminator 14))
[6] ScriptEditorDebugger::_notificationv(int, bool) (/home/akien/Projects/godot/godot.git/./editor/debugger/script_editor_debugger.h:60 (discriminator 14))
[7] Object::notification(int, bool) (/home/akien/Projects/godot/godot.git/./core/object/object.cpp:800)
[8] SceneTree::_process_group(SceneTree::ProcessGroup*, bool) (/home/akien/Projects/godot/godot.git/./scene/main/scene_tree.cpp:948)
[9] SceneTree::_process(bool) (/home/akien/Projects/godot/godot.git/./scene/main/scene_tree.cpp:1020 (discriminator 2))
[10] SceneTree::process(double) (/home/akien/Projects/godot/godot.git/./scene/main/scene_tree.cpp:510)
[11] Main::iteration() (/home/akien/Projects/godot/godot.git/main/main.cpp:3443)
[12] OS_LinuxBSD::run() (/home/akien/Projects/godot/godot.git/platform/linuxbsd/os_linuxbsd.cpp:912)
[13] /home/akien/Projects/godot/godot.git/bin/godot.linuxbsd.editor.dev.x86_64(main+0x15a) [0x574bf40] (/home/akien/Projects/godot/godot.git/platform/linuxbsd/godot_linuxbsd.cpp:76)
[14] /lib64/libc.so.6(+0x236b7) [0x7f98954dc6b7] (??:0)
[15] /lib64/libc.so.6(__libc_start_main+0x85) [0x7f98954dc775] (??:0)
[16] /home/akien/Projects/godot/godot.git/bin/godot.linuxbsd.editor.dev.x86_64(_start+0x21) [0x574bd21] (??:?)
-- END OF BACKTRACE --
================================================================
Godot 3.1.1
I made a script class which has a
clear()
function, for which the goal is to cleanup some external resources. It can be called by code using the class, or at the destruction of the instance. The only destructor logic that I know of isNOTIFICATION_PREDELETE
. However... that doesn't work :(When I run this, I get the following error:
Which isn't helping here, and makes no sense because
_notification
was called in the first place. I would like to be be able to call functions of my own script, otherwise I have to entirely copy/paste its contents...Note: that situation only seems to occur with
References
. If I inheritNode
andfree()
it, the code runs normally. I tested with inner classes but the same issue happens with file scripts.