Compilation failure in test_graph_node.h
with disable_exceptions=false
#94833
Labels
Milestone
test_graph_node.h
with disable_exceptions=false
#94833
Tested versions
Reproducible in 4.3 RC1 [607b230]
System information
Godot v4.3.rc (607b230) - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (nvidia; 535.183.01) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)
Issue description
test_graph_node.h
compilation fails whendisable_exception=false
is used:When exceptions are enabled, a compilation error occurs because
CHECK_NOTHROW_MESSAGE
expects an error message argument. In this case the fix would be to provide one, or useCHECK_NOTHROW
instead andmemdelete
the child to fix the memory leak.When exceptions are disabled the check macro (and its argument) expand to nothing:
remove_child
is not called and there is no memory leak because the child is still parented.IMO the correct fix is to drop the
CHECK_NOTHROW
macro, always callremove_child
and make sure the child is deleted. We could add aCHECK
on the child count instead.Note:
CHECK_NOTHROW
macro and its variant are never used in the codebase except there.Related: Fix error message when removing only child from GraphNode #90229
Steps to reproduce
Try to build Godot's tests with
disable_exceptions=false
In my case:
scons platform=linuxbsd target=editor dev_build=yes tests=true disable_exceptions=false -j9
Minimal reproduction project (MRP)
NA
The text was updated successfully, but these errors were encountered: