aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index c5e5f87e..17f94c23 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -70,16 +70,14 @@ TYPEDEF_VECTOR(DevMap, vector_DevMap)
static void clear_devlist(vector_DevMap *list)
{
- DevMap *iter, *end;
-
- iter = VECTOR_ITER_BEGIN(*list);
- end = VECTOR_ITER_END(*list);
- for(;iter != end;iter++)
- {
- AL_STRING_DEINIT(iter->name);
- free(iter->devid);
- }
+#define CLEAR_DEVMAP(i) do { \
+ AL_STRING_DEINIT((i)->name); \
+ free((i)->devid); \
+ (i)->devid = NULL; \
+} while(0)
+ VECTOR_FOR_EACH(DevMap, *list, CLEAR_DEVMAP);
VECTOR_RESIZE(*list, 0);
+#undef CLEAR_DEVMAP
}
static vector_DevMap PlaybackDevices;