| 51 | } |
| 52 | |
| 53 | void 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 |
no test coverage detected