diff options
author | Chris Robinson <[email protected]> | 2019-06-05 17:25:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-05 17:25:08 -0700 |
commit | 5f26205f8fb504c5f6fec3e2b02f0009a4f24be2 (patch) | |
tree | 606172569e4f406a11cbef0bd9bc3fc8d59c6d06 | |
parent | f27e73989c9831cde96880edafb01e662a7de2db (diff) |
Properly destroy other objects
-rw-r--r-- | Alc/alc.cpp | 4 | ||||
-rw-r--r-- | Alc/alu.cpp | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 6 | ||||
-rw-r--r-- | OpenAL32/alBuffer.cpp | 4 | ||||
-rw-r--r-- | OpenAL32/alEffect.cpp | 4 | ||||
-rw-r--r-- | OpenAL32/alFilter.cpp | 4 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 4 | ||||
-rw-r--r-- | OpenAL32/event.cpp | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 8378673d..b7be4f7b 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2462,14 +2462,14 @@ ALCcontext::~ALCcontext() auto evt_vec = AsyncEvents->getReadVector(); while(evt_vec.first.len > 0) { - reinterpret_cast<AsyncEvent*>(evt_vec.first.buf)->~AsyncEvent(); + al::destroy_at(reinterpret_cast<AsyncEvent*>(evt_vec.first.buf)); evt_vec.first.buf += sizeof(AsyncEvent); evt_vec.first.len -= 1; ++count; } while(evt_vec.second.len > 0) { - reinterpret_cast<AsyncEvent*>(evt_vec.second.buf)->~AsyncEvent(); + al::destroy_at(reinterpret_cast<AsyncEvent*>(evt_vec.second.buf)); evt_vec.second.buf += sizeof(AsyncEvent); evt_vec.second.len -= 1; ++count; diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 97ebf0cb..00867810 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -181,7 +181,7 @@ void aluInit(void) void DeinitVoice(ALvoice *voice) noexcept { delete voice->mUpdate.exchange(nullptr, std::memory_order_acq_rel); - voice->~ALvoice(); + al::destroy_at(voice); } diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index eeb545c9..4c7b3507 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -204,7 +204,7 @@ ALeffectslot *AllocEffectSlot(ALCcontext *context) ALenum err{InitEffectSlot(slot)}; if(err != AL_NO_ERROR) { - slot->~ALeffectslot(); + al::destroy_at(slot); alSetError(context, err, "Effect slot object initialization failed"); return nullptr; } @@ -225,7 +225,7 @@ void FreeEffectSlot(ALCcontext *context, ALeffectslot *slot) ALsizei lidx = id >> 6; ALsizei slidx = id & 0x3f; - slot->~ALeffectslot(); + al::destroy_at(slot); context->EffectSlotList[lidx].FreeMask |= 1_u64 << slidx; context->NumEffectSlots--; @@ -794,7 +794,7 @@ EffectSlotSubList::~EffectSlotSubList() while(usemask) { ALsizei idx{CTZ64(usemask)}; - EffectSlots[idx].~ALeffectslot(); + al::destroy_at(EffectSlots+idx); usemask &= ~(1_u64 << idx); } FreeMask = ~usemask; diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp index 738133f5..ec733ae1 100644 --- a/OpenAL32/alBuffer.cpp +++ b/OpenAL32/alBuffer.cpp @@ -108,7 +108,7 @@ void FreeBuffer(ALCdevice *device, ALbuffer *buffer) ALsizei lidx = id >> 6; ALsizei slidx = id & 0x3f; - buffer->~ALbuffer(); + al::destroy_at(buffer); device->BufferList[lidx].FreeMask |= 1_u64 << slidx; } @@ -1219,7 +1219,7 @@ BufferSubList::~BufferSubList() while(usemask) { ALsizei idx{CTZ64(usemask)}; - Buffers[idx].~ALbuffer(); + al::destroy_at(Buffers+idx); usemask &= ~(1_u64 << idx); } FreeMask = ~usemask; diff --git a/OpenAL32/alEffect.cpp b/OpenAL32/alEffect.cpp index 51474af0..a2a40ac5 100644 --- a/OpenAL32/alEffect.cpp +++ b/OpenAL32/alEffect.cpp @@ -183,7 +183,7 @@ void FreeEffect(ALCdevice *device, ALeffect *effect) ALsizei lidx = id >> 6; ALsizei slidx = id & 0x3f; - effect->~ALeffect(); + al::destroy_at(effect); device->EffectList[lidx].FreeMask |= 1_u64 << slidx; } @@ -518,7 +518,7 @@ EffectSubList::~EffectSubList() while(usemask) { ALsizei idx = CTZ64(usemask); - Effects[idx].~ALeffect(); + al::destroy_at(Effects+idx); usemask &= ~(1_u64 << idx); } FreeMask = ~usemask; diff --git a/OpenAL32/alFilter.cpp b/OpenAL32/alFilter.cpp index cf393692..d7826b6f 100644 --- a/OpenAL32/alFilter.cpp +++ b/OpenAL32/alFilter.cpp @@ -327,7 +327,7 @@ void FreeFilter(ALCdevice *device, ALfilter *filter) ALsizei lidx = id >> 6; ALsizei slidx = id & 0x3f; - filter->~ALfilter(); + al::destroy_at(filter); device->FilterList[lidx].FreeMask |= 1_u64 << slidx; } @@ -647,7 +647,7 @@ FilterSubList::~FilterSubList() while(usemask) { ALsizei idx = CTZ64(usemask); - Filters[idx].~ALfilter(); + al::destroy_at(Filters+idx); usemask &= ~(1_u64 << idx); } FreeMask = ~usemask; diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index d2414e50..6d4daecd 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -544,7 +544,7 @@ void FreeSource(ALCcontext *context, ALsource *source) } backlock.unlock(); - source->~ALsource(); + al::destroy_at(source); context->SourceList[lidx].FreeMask |= 1_u64 << slidx; context->NumSources--; @@ -3575,7 +3575,7 @@ SourceSubList::~SourceSubList() while(usemask) { ALsizei idx{CTZ64(usemask)}; - Sources[idx].~ALsource(); + al::destroy_at(Sources+idx); usemask &= ~(1_u64 << idx); } FreeMask = ~usemask; diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp index f01227e9..2ee296b0 100644 --- a/OpenAL32/event.cpp +++ b/OpenAL32/event.cpp @@ -42,7 +42,7 @@ static int EventThread(ALCcontext *context) RingBuffer *ring_; ~EventAutoDestructor() { - evt_.~AsyncEvent(); + al::destroy_at(&evt_); ring_->readAdvance(1); } } _{evt, ring}; @@ -99,7 +99,7 @@ static int EventThread(ALCcontext *context) void StartEventThrd(ALCcontext *ctx) { try { - ctx->EventThread = std::thread(EventThread, ctx); + ctx->EventThread = std::thread{EventThread, ctx}; } catch(std::exception& e) { ERR("Failed to start event thread: %s\n", e.what()); |