MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / decRef

Method decRef

Source/Falcor/Core/Object.cpp:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void Object::decRef(bool dealloc) const noexcept
54{
55 uint32_t refCount = mRefCount.fetch_sub(1);
56 if (refCount <= 0)
57 {
58 reportFatalErrorAndTerminate("Internal error: Object reference count < 0!");
59 }
60 else if (refCount == 1)
61 {
62#if FALCOR_ENABLE_OBJECT_TRACKING
63 {
64 std::lock_guard<std::mutex> lock(sTrackedObjectsMutex);
65 sTrackedObjects.erase(this);
66 }
67#endif
68 if (dealloc)
69 delete this;
70 }
71}
72
73#if FALCOR_ENABLE_OBJECT_TRACKING
74

Callers 1

DeviceMethod · 0.45

Calls 3

eraseMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected