diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index 9c701bfb4..535d3feda 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -504,14 +504,13 @@ void Audio::cleanupOutput() alSourceStop(alMainSource); alDeleteSources(1, &alMainSource); - ALCdevice* device = alcGetContextsDevice(alContext); if (!alcMakeContextCurrent(nullptr)) qWarning("Failed to clear current audio context."); alcDestroyContext(alContext); alContext = nullptr; - if (alcCloseDevice(device)) + if (alcCloseDevice(alOutDev)) alOutDev = nullptr; else qWarning("Failed to close output.");