mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
Fix outdated use of File in gdscript_basics
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user