Fix potential segfault in AL.

This commit is contained in:
Themaister 2013-02-11 20:38:16 +01:00
parent fe1d9a5a2a
commit 8c4410158d

View File

@ -67,8 +67,11 @@ static void al_free(void *data)
free(al->buffers);
free(al->res_buf);
alcMakeContextCurrent(NULL);
alcDestroyContext(al->ctx);
alcCloseDevice(al->handle);
if (al->ctx)
alcDestroyContext(al->ctx);
if (al->handle)
alcCloseDevice(al->handle);
free(al);
}