From 1a1500cebeeccf719e79ab420db3a1387a6efba4 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Sat, 15 Jul 2023 23:16:57 +0200 Subject: [PATCH] Fix outdated use of `File` in `gdscript_basics` --- tutorials/scripting/gdscript/gdscript_basics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/scripting/gdscript/gdscript_basics.rst b/tutorials/scripting/gdscript/gdscript_basics.rst index 4391fb489b4..64ad1428fa3 100644 --- a/tutorials/scripting/gdscript/gdscript_basics.rst +++ b/tutorials/scripting/gdscript/gdscript_basics.rst @@ -1865,9 +1865,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)