1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

cleanup close audio out device

This commit is contained in:
Nils Fenner 2015-11-08 22:23:01 +01:00
parent 872be36225
commit d631ddbc86
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C

View File

@ -504,14 +504,13 @@ void Audio::cleanupOutput()
alSourceStop(alMainSource); alSourceStop(alMainSource);
alDeleteSources(1, &alMainSource); alDeleteSources(1, &alMainSource);
ALCdevice* device = alcGetContextsDevice(alContext);
if (!alcMakeContextCurrent(nullptr)) if (!alcMakeContextCurrent(nullptr))
qWarning("Failed to clear current audio context."); qWarning("Failed to clear current audio context.");
alcDestroyContext(alContext); alcDestroyContext(alContext);
alContext = nullptr; alContext = nullptr;
if (alcCloseDevice(device)) if (alcCloseDevice(alOutDev))
alOutDev = nullptr; alOutDev = nullptr;
else else
qWarning("Failed to close output."); qWarning("Failed to close output.");