From 5b2b96b24598636e35f1fe7ecf868b09571065d6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 25 Nov 2018 17:51:39 -0800 Subject: Don't explicitly clear vector objects in the destructor --- Alc/alc.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 56bfb875..a3c6b5bd 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2390,37 +2390,33 @@ ALCdevice_struct::~ALCdevice_struct() { TRACE("%p\n", this); - if(Backend) - DELETE_OBJ(Backend); + DELETE_OBJ(Backend); Backend = nullptr; - almtx_destroy(&BackendLock); - size_t count{0u}; for(auto &sublist : BufferList) count += POPCNT64(~sublist.FreeMask); if(count > 0) WARN(SZFMT " Buffer%s not deleted\n", count, (count==1)?"":"s"); - BufferList.clear(); - almtx_destroy(&BufferLock); count = 0; for(auto &sublist : EffectList) count += POPCNT64(~sublist.FreeMask); if(count > 0) WARN(SZFMT " Effect%s not deleted\n", count, (count==1)?"":"s"); - EffectList.clear(); - almtx_destroy(&EffectLock); count = 0; for(auto &sublist : FilterList) count += POPCNT64(~sublist.FreeMask); if(count > 0) WARN(SZFMT " Filter%s not deleted\n", count, (count==1)?"":"s"); - FilterList.clear(); + + almtx_destroy(&BackendLock); + + almtx_destroy(&BufferLock); + almtx_destroy(&EffectLock); almtx_destroy(&FilterLock); - HrtfList.clear(); if(HrtfHandle) Hrtf_DecRef(HrtfHandle); HrtfHandle = nullptr; -- cgit v1.2.3