Tested versions
4.3-stable
System information
Windows 11
Issue description
Calling ResourceLoader.load_threaded_request without ResourceLoader.load_threaded_get causes leaks of ResourceLoader::LoadToken.
extends Node2D
const path := "res://icon.svg"
var finished := false
func _ready() -> void:
var err := ResourceLoader.load_threaded_request(path, "", true, ResourceLoader.CACHE_MODE_IGNORE)
print("load_threaded_request: %s" % error_string(err))
func _process(delta: float) -> void:
if (finished):
return
var status = ResourceLoader.load_threaded_get_status(path)
if (status != ResourceLoader.THREAD_LOAD_IN_PROGRESS):
finished = true
# without the following line, a ResourceLoader.LoadToken will be leaked
# ResourceLoader.load_threaded_get(path)
print("loaded")
I don't know whether it's expected behavior or not?
Steps to reproduce
Run the project scene from godot editor executable with parameters:
--verbose --path "PATH_TO_PROJECT/resource_loader_test" res://node_2d.tscn
ObjectDB::cleanup() will report a leaked instance which is a ResourceLoader::LoadToken.
Minimal reproduction project (MRP)
resource_loader_test.zip
Tested versions
4.3-stable
System information
Windows 11
Issue description
Calling
ResourceLoader.load_threaded_requestwithoutResourceLoader.load_threaded_getcauses leaks ofResourceLoader::LoadToken.I don't know whether it's expected behavior or not?
Steps to reproduce
Run the project scene from godot editor executable with parameters:
--verbose --path "PATH_TO_PROJECT/resource_loader_test" res://node_2d.tscnObjectDB::cleanup() will report a leaked instance which is a
ResourceLoader::LoadToken.Minimal reproduction project (MRP)
resource_loader_test.zip