fix: improve doc link navigation and tree display
- 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
This commit is contained in:
31
docs/api/resources/resourcehandle/reset.md
Normal file
31
docs/api/resources/resourcehandle/reset.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# ResourceHandle::Reset
|
||||
|
||||
```cpp
|
||||
void Reset()
|
||||
```
|
||||
|
||||
释放当前持有的资源引用。如果内部持有的资源指针非空,则调用 `ResourceManager::Release()` 减少引用计数,并将内部指针置为 `nullptr`。析构函数会自动调用此方法。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourceHandle<Texture> tex = ResourceManager::Get().Load<Texture>("tex.png");
|
||||
// 使用纹理...
|
||||
tex.Reset(); // 释放引用,引用计数 -1
|
||||
|
||||
// 或者让句柄离开作用域自动释放
|
||||
{
|
||||
ResourceHandle<Mesh> mesh = ResourceManager::Get().Load<Mesh>("model.fbx");
|
||||
// 使用网格...
|
||||
} // mesh 自动 Reset()
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ResourceHandle 总览](resourcehandle.md) - 返回类总览
|
||||
Reference in New Issue
Block a user