- 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
734 B
734 B
RefCounted::AddRef
void AddRef();
增加引用计数。
描述
原子地增加引用计数。在复制 RefCounted 指针或传递引用时调用此方法。
复杂度: O(1)
示例:
#include <XCEngine/Core/RefCounted.h>
class MyObject : public RefCounted {
public:
void DoSomething() { /* ... */ }
};
// 创建对象(构造时 refCount = 1)
MyObject* obj = new MyObject();
// 手动增加引用
obj->AddRef(); // refCount = 2
obj->AddRef(); // refCount = 3
// 需要释放额外的引用
obj->Release(); // refCount = 2
obj->Release(); // refCount = 1
相关文档
- RefCounted 总览 - 返回类总览
- Release - 减少引用计数