Merge pull request #7667 from AThousandShips/file_fix

This commit is contained in:
Max Hilbrunner
2023-07-18 13:12:30 +02:00
committed by Max Hilbrunner
parent a69f17ab91
commit 8c25bbe8b3

View File

@@ -1750,9 +1750,9 @@ Here is an example:
var my_file_ref
func _ready():
var f = File.new()
var f = FileAccess.open("user://example_file.json", FileAccess.READ)
my_file_ref = weakref(f)
# the File class inherits RefCounted, so it will be freed when not in use
# the FileAccess class inherits RefCounted, so it will be freed when not in use
# the WeakRef will not prevent f from being freed when other_node is finished
other_node.use_file(f)