- 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
758 B
758 B
ResourceHandle::Reset
void Reset()
释放当前持有的资源引用。如果内部持有的资源指针非空,则调用 ResourceManager::Release() 减少引用计数,并将内部指针置为 nullptr。析构函数会自动调用此方法。
参数: 无
返回: 无
复杂度: O(1)
示例:
ResourceHandle<Texture> tex = ResourceManager::Get().Load<Texture>("tex.png");
// 使用纹理...
tex.Reset(); // 释放引用,引用计数 -1
// 或者让句柄离开作用域自动释放
{
ResourceHandle<Mesh> mesh = ResourceManager::Get().Load<Mesh>("model.fbx");
// 使用网格...
} // mesh 自动 Reset()
相关文档
- ResourceHandle 总览 - 返回类总览