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:
parent
872be36225
commit
d631ddbc86
|
@ -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.");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user