This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
Freeing a RigidBody2D containing an Area2D node triggers an error condition #95
Labels
bug
Something isn't working
Describe the bug
Calling
queue_free()
on aRigidBody2D
node that has anArea2D
child triggers an error condition:This message is repeated several times when trying to free the
RigidBody2D
. The number of times appears to be related to the number of physics-relevant child nodes of the body. In larger projects, the error log easily gets spammed by hundreds of messages.While the
RigidBody2D
is still removed from the scene tree (at least, it's not visible in the "Remote" view anymore), it is unclear to me whether the current behavior may cause memory leaks as thequeue_free()
call might not be completed fully.To Reproduce
To reproduce, the following scene
RigidBody
will be used:This scene is added as a child to the project's main scene:
The script attached to this main scene will try to call
queue_free()
onTestBody
if SPACE is pressed:When running this scene and pressing SPACE, the error condition
"foundIt == detected_bodies.end()" is true.
is triggered three times.Expected behavior
Calling
queue_free()
on aRigidBody2D
node should not trigger an error condition if the node contains anArea2D
child. nodeProject
The reproducible minimal project described above is attached as a file (including Box2D as an installed add-on):
Box2DAreaRemove.zip
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: