Im getting errors when I exit my game

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

Im using get_tree().quit()to close the game in-game but it is giving errors on my console(not the output box. The literal non-gui console). heres the error

OpenGL ES 3.0 Renderer: GeForce MX130/PCIe/SSE2
ERROR: ~List: Condition ' _first != __null ' is true.
   At: ./core/self_list.h:111
ERROR: ~List

I want to exit my game error free so what do I do?

I don’t know your situation, but those may be errors from the engine itself, and not from your game. If I recall, I have encountered errors in the past when one of my Godot applications exited.

Ertain | 2019-07-21 23:26

It was an awful situation and i was glad i recalled my c programming classes about this xD. It was a ‘used data, not released error’(I don’t know the exact term), basically yeah it isn’t a bug by the engine but was because I instantiated something, gave it a value, but that data was never released after the game(or program) exited. So it made my pc set a portion of its hard drive storage memory to be permanently “used” despite not actually being in used. I’m explaining because this is a serious bug, my teacher told that it is because of this specific kind of bug, your pc storage grows smaller each time you run an application with this kind of bug. Its one of those permanently damaging kinds that happen can only be fixed by an expert :frowning: Spread awareness #noToBuggedApps(I dont actually know how to make a hashtag here :P)

Xian | 2019-07-28 12:48

:bust_in_silhouette: Reply From: Xian

I was reading a post about
https://forum.godotengine.org/7084/causing-error-selflist-class-gdfunction-condition-_first
and

And both of these made me remember my programming class about freeing the data that has been called after it was used. It went like this. Whenever you call something new you must always release the data that was called after using it.

So basically, I have several functions that call or load a new script to my scene. So i just added

NameOfNewlyCalledObject.free()
get_tree().quit()

And my console never showed the error ever again :slight_smile:

I got better I found that this doesn’t always work so I’m just posting this out.
You can use :

get_tree().queue_free()

or

get_tree().queue_delete(get_tree())

these work better for most cases.

Xian | 2020-02-21 02:05