Queue_free() not working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stevepetoskey

So I have the basic code that removes all children from a node:

	for child in get_node("PanelCarry").get_children():

Normally this works just fine for me how every now it is not removing any of the children. Behind the scenes the children I am trying to queue free are instanced in by code however this has never been a problem for me. As for any other crazy things going on there is none that should ever effect this. Thank you for any answers

:bust_in_silhouette: Reply From: cgeadas

Is child getting any nodes from get_node("PanelCarry").get_children()?
A print(child) might help to see that. If you get nulls there’s nothing there to free.

yeah it even prints exactly what I want it to free but for some reason it just does not free it.

stevepetoskey | 2020-07-08 21:52

And still for testing, have you tried just “free()”?
The worst it can happen is to crash the program, but at least you see that there is something happening.

cgeadas | 2020-07-08 22:10

yeah it crashes my program. To give you more information, I tried printing the child count before and after the code was ran and the number stayed the same.

stevepetoskey | 2020-07-08 22:41

So the problem may not be the queue_free but something that doesn’t release the nodes. But for that I have no ideas.

cgeadas | 2020-07-08 22:51