Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null references not working as intended in Godot 4.3 dev6? #92569

Closed
jktrctt opened this issue May 30, 2024 · 1 comment
Closed

Null references not working as intended in Godot 4.3 dev6? #92569

jktrctt opened this issue May 30, 2024 · 1 comment
Labels

Comments

@jktrctt
Copy link

jktrctt commented May 30, 2024

Tested versions

Reproducible in 4.3 dev6

System information

Windows 10, Godot 4.3 dev6, Vulcan dedicated

Issue description

In 4.3 dev6, null references to objects that were freed do not work in the same way they did in 4.2. For example, if a variable contains a reference to an object and the object is freed, the statement:
if object_reference != null
no longer returns false.

Steps to reproduce

Run this project in both 4.2 and 4.3 dev6 and you will see that it behaves differently.

Or just run this code in a blank scene with a Node2D in it:

extends Node2D


var reference : Node2D


func _ready():
	reference = $Node2D
	print(reference)
	reference.queue_free()
	

func _process(delta):
	if reference != null:
		print(reference)

Minimal reproduction project (MRP)

MRP.zip

@akien-mga
Copy link
Member

This was an intentional change in 4.3, see #73896 and #90513 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants