1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-27 02:23:27 +01:00

Merge pull request #283 from stal888/master

Destroy AL context before closing dhndl
This commit is contained in:
JFreegman 2014-11-29 08:18:56 -05:00
commit 7e49ba92b2

View File

@ -323,9 +323,9 @@ DeviceError close_device(DeviceType type, uint32_t device_idx)
alDeleteSources(1, &device->source); alDeleteSources(1, &device->source);
alDeleteBuffers(OPENAL_BUFS, device->buffers); alDeleteBuffers(OPENAL_BUFS, device->buffers);
if ( !alcCloseDevice(device->dhndl) ) rc = de_AlError;
alcMakeContextCurrent(NULL); alcMakeContextCurrent(NULL);
if ( device->ctx ) alcDestroyContext(device->ctx); if ( device->ctx ) alcDestroyContext(device->ctx);
if ( !alcCloseDevice(device->dhndl) ) rc = de_AlError;
} }
free(device); free(device);