diff options
author | Chris Robinson <[email protected]> | 2019-08-01 13:28:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-01 13:43:32 -0700 |
commit | 65f7fc610e6a6101509906c0c9bbbd794c9a3737 (patch) | |
tree | 48e03a76d121d2927623c8982c149acb0a8d616e /alc/hrtf.cpp | |
parent | 380f3dc11de1b3d8e6a00b2920cb809cfb953c0d (diff) |
Add a common base for auto-deleting ref-counted objects
Which will also work as the basis for a future intrusive_ptr
Diffstat (limited to 'alc/hrtf.cpp')
-rw-r--r-- | alc/hrtf.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp index 124707c5..a8b56019 100644 --- a/alc/hrtf.cpp +++ b/alc/hrtf.cpp @@ -484,7 +484,7 @@ std::unique_ptr<HrtfEntry> CreateHrtfStore(ALuint rate, ALsizei irSize, const AL ERR("Out of memory allocating storage for %s.\n", filename); else { - InitRef(&Hrtf->ref, 1u); + InitRef(Hrtf->ref, 1u); Hrtf->sampleRate = rate; Hrtf->irSize = irSize; Hrtf->fdCount = fdCount; @@ -1373,13 +1373,13 @@ HrtfEntry *GetLoadedHrtf(HrtfHandle *handle) void HrtfEntry::IncRef() { - auto ref = IncrementRef(&this->ref); + auto ref = IncrementRef(this->ref); TRACEREF("HrtfEntry %p increasing refcount to %u\n", this, ref); } void HrtfEntry::DecRef() { - auto ref = DecrementRef(&this->ref); + auto ref = DecrementRef(this->ref); TRACEREF("HrtfEntry %p decreasing refcount to %u\n", this, ref); if(ref == 0) { @@ -1389,7 +1389,7 @@ void HrtfEntry::DecRef() auto delete_unused = [](HrtfHandlePtr &handle) -> void { HrtfEntry *entry{handle->entry.get()}; - if(entry && ReadRef(&entry->ref) == 0) + if(entry && ReadRef(entry->ref) == 0) { TRACE("Unloading unused HRTF %s\n", handle->filename.data()); handle->entry = nullptr; |