This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I get this error when I close the game:

ERROR: ~List: Condition "_first != __null" is true.
At: ./core/self_list.h:112
ERROR: ~List: Condition "_first != __null" is true.
At: ./core/self_list.h:112
WARNING: cleanup: ObjectDB instances leaked at exit (run with --verbose for details).
At: core/object.cpp:2135
ERROR: clear: Resources still in use at exit (run with --verbose for details).
At: core/resource.cpp:477

It happens if I use a autoload with classname,
and declare a variable of the same type of that classname:

extends Node
class_name Region
var child:Region

or create a function with a reference to that classname.

extends Node
class_name Region

func create_region(par:Region):

I tried Regions.queuefree() before _exittree() but to no prevail.

Is this type of coding not allowed?
If so, how else could I do this?

in Engine by (52 points)

2 Answers

0 votes

I really, really don't get it.
Even if I create a script:

extends Node2D

class_name Motorcycle

var speed = 0

and just put it somewhere in the res:// folder.
in a tree with just a Node2D, with a script:

extends Node2D

var ab = Motorcycle.new()

func _ready() -> void:
print(ab.speed)

It prints the speed!?
And I still get the same error if I close the program.
Help!

by (52 points)
0 votes

I still don't get it.
But I've got something working.

The script attached to a Node2D:

extends Node2D

var ab = Motorcycle.new()

func _ready() -> void:
print(ab.speed)

and in an other script , somewhere in the res:// folder:

class_name Motorcycle

var speed = 0

It prints the speed.
And when I use yet an other script:

extends Motorcycle

class_name Car
var test:Motorcycle

I am allowed to reference 'Motorcycle' in a variable.
And closing does not give an error.
Strange, because the 'car' is an extended 'Motorcycle'
Perhaps someone can explain this, because I would like to understand.

edit:I really shouldn't answer my own questions. (And this was the second one!)

by (52 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 Frequently asked questions and 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 [email protected] with your username.