diff options
author | Chris Robinson <[email protected]> | 2012-03-02 00:10:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-03-02 00:10:24 -0800 |
commit | f784aa704dfb3fdd2bfe4ee155ce165cd603186a (patch) | |
tree | bea2c50befd4ec07398c90ce95a1b80aaf0374bd /Alc | |
parent | 153affac12bbacdb6c75e5bde708c9ac034d62a2 (diff) |
Make sure the device gets stopped when closing even if there's no contexts
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2653,15 +2653,15 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *pDevice) *list = (*list)->next; UnlockLists(); - if((ctx=pDevice->ContextList) != NULL) + while((ctx=pDevice->ContextList) != NULL) { - do { - WARN("Releasing context %p\n", ctx); - ReleaseContext(ctx, pDevice); - } while((ctx=pDevice->ContextList) != NULL); - ALCdevice_StopPlayback(pDevice); - pDevice->Flags &= ~DEVICE_RUNNING; + WARN("Releasing context %p\n", ctx); + ReleaseContext(ctx, pDevice); } + if((pDevice->Flags&DEVICE_RUNNING)) + ALCdevice_StopPlayback(pDevice); + pDevice->Flags &= ~DEVICE_RUNNING; + ALCdevice_ClosePlayback(pDevice); ALCdevice_DecRef(pDevice); |