+1 vote

Hello, fellow Godot users. I'm fairly new to using the engine and have a minor problem.

I get the following two error messages upon exiting my game:

"ERROR: SelfList<class GDFunction>::List::~List: Condition ' _first!=0 ' is true"
At: core\self_list.h:82
"ERROR: SelfList<class GDScript>::List::~List: Condition '  _first!=0 ' is true"
At: core\self_list.h:82

Looking at where the error refers to...
https://github.com/godotengine/godot/blob/master/core/self_list.h
...my guess is that one or more of my GDScript files are still in use when the game exists, so the list keeping track of them can't completely free its resources.

Can anyone shed some light on this and help me understand these errors?

Thanks in advance!

in Engine by (51 points)

ERROR: ~List: Condition "_first != __null" is true.
At: ./core/self_list.h:112
Should this not be a warning??
still exists in 3.2.3 and yes I load the resources. shows up in executable on windows.

I don't always have the scene that created the instance so when exiting tree they have to be located .... so ignoring this is not ok ... how do we hide this?

docs show
func exittree():
# When the node exits the Scene Tree, this function is called.
# Children nodes have all exited the Scene Tree at this point
# and all became inactive.
pass

3 Answers

+4 votes

OK, so I think the errors are the editor's way of complaining that there were resources, in general, which were not freed upon exiting the application.

For instance, doing something like...

var local_scene = null
func _ready():
    var resource = load("res://MyScene.tscn")
    local_scene = resource.instance()

# Ignore responsibility for freeing 'local_scene'
func _exit_tree():
    pass

...seems to trigger the two errors. But it can be resolved by calling .free() on the variables using instanced resources:

func _exit_tree():
    local_scene.free()

Additionally, it seems like .queue_free() might NOT work in some cases. I will update my findings when I learn more.

Any comments, corrections, or feedback in the meantime would be appreciated.

by (51 points)
0 votes

Hello, friend.
I was getting the same error after closing my game. The only thing that worked for me was making my own signal.

Declaring the signal close to the variables

signal destroyed

Using it with queue_free()

queue_free()
emit_signal("destroyed")

And calling it in the place of exit_tree in connect

local_scene.connect("destroyed",self,"function_to_use")

No more error for me after that. Hope it helps you or others with similar problems.

by (14 points)
0 votes

Hello,
I think this is a bug, and I succeeded in isolating it.

As I don't know how to fix it, I created an issue:
https://github.com/godotengine/godot/issues/8985
Maybe someone will be able to help us!

by (279 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.