godotengine / godotengine/godot-docs
Missing notes in ResourceLoader threaded load function documentation
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:** 4.1.1
**Issue description:**
I encountered a few undocumented behaviors/details in the documentation for ResourceLoader while learning how to use it's threaded functions (`load_threaded_request`, `load_threaded_get_status`, and `load_threaded_get`) which made working with it a bit tricky. I believe this page could benefit from additional '**Note:**' lines to help inform the user on how threaded resource loading behaves in more detail, specifically for these items:
- It's currently not clear what happens to resources that are requested via `load_threaded_request()` after they are captured by `load_threaded_get()` (they appear to be removed from ResourceLoader as calling `load_threaded_get()` on the path a second time will return null, even though the documentation suggests that the resource becomes 'cached' for future calls).
- It's currently not clear what happens to resources that are requested via `load_threaded_request()` if `load_threaded_get()` is never called on this path. While this should never occur with clean code, it would be helpful to know if they stay in memory forever *or* what situations could lead to this memory being freed.
- It's currently unclear if there is a way to clear the cache and/or free up resources that have been requested via `load_threaded_request()`. While `var localVar = load_threaded_get(path)` can clear out a requested resource with a given path, there doesn't seem to be a clear method to clear all of these resources, clear a cached resource, or browse what resources have been requested/cached.
**URL to the documentation page (if already existing):** https://docs.godotengine.org/en/stable/classes/class_resourceloader.html
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.