- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
27 lines
486 B
Markdown
27 lines
486 B
Markdown
# ResourceManager::UnloadUnused
|
|
|
|
```cpp
|
|
void UnloadUnused()
|
|
```
|
|
|
|
卸载所有无引用的资源。遍历资源缓存,将引用计数为零的资源全部释放。常在场景切换或内存紧张时调用。
|
|
|
|
**参数:** 无
|
|
|
|
**返回:** 无
|
|
|
|
**复杂度:** O(n)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
// 切换场景时清理无用资源
|
|
void OnSceneUnload() {
|
|
ResourceManager::Get().UnloadUnused();
|
|
}
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [ResourceManager 总览](resourcemanager.md) - 返回类总览
|