-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Memory leak when using get_last_slide_collision()
#57073
Comments
godot/modules/gdscript/gdscript_vm.cpp Lines 1819 to 1823 in 0509086
Looking to backtraces on gdb, ret_opaque is a pointer to a Ref<KinematicCollision2D> that references count increases in method->ptrcall(base_obj, argptrs, ret_opaque); but isn't unreferenced therefore. The references count also increases in VariantInternal::object_assign(ret, *ret_opaque); , but is unferenced at the end of the gdscript scope: godot/modules/gdscript/gdscript_vm.cpp Lines 3353 to 3355 in 0509086
|
Sorry, but I don't know if it's fittable to talk it here: I think a probable fix is to clear all old elements in |
Godot version
v4.0.dev.custom_build [b5f524d]
System information
Linux Mint - Vulkan API 1.2.131 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080
Issue description
Using
get_last_slide_collision()
causes object to be created but never deleted.This can be seen in the object count in the profiler.
Steps to reproduce
Use a
CharacterBody2D
and useget_last_slide_collision()
when a collision happenes.Check with
Performance.get_monitor(Performance.OBJECT_COUNT)
or the profiler in the editor that the object count is only increasing.OR
Run the attached project to see the issue with everything prepared.
Minimal reproduction project
MemoryLeak_get_last_slide_collision.zip
The text was updated successfully, but these errors were encountered: