Commit 468eaa7e authored by Matthieu Gallien's avatar Matthieu Gallien 🎵 Committed by Nate Graham

prevent crash by stopping play before freeing libvlc resources

also release the inhibition on power state management

BUG: 424891

CCBUG: 421662
parent 7fab8f86
Pipeline #41438 canceled with stage
......@@ -126,6 +126,10 @@ AudioWrapper::AudioWrapper(QObject *parent) : QObject(parent), d(std::make_uniqu
AudioWrapper::~AudioWrapper()
{
if (d->mInstance) {
d->mPowerInterface.setPreventSleep(false);
if (d->mPlayer && d->mPreviousPlayerState != QMediaPlayer::StoppedState) {
libvlc_media_player_stop(d->mPlayer);
}
libvlc_release(d->mInstance);
}
}
......
......@@ -47,7 +47,9 @@ AudioWrapper::AudioWrapper(QObject *parent) : QObject(parent), d(std::make_uniqu
}
AudioWrapper::~AudioWrapper()
= default;
{
d->mPowerInterface.setPreventSleep(false);
}
bool AudioWrapper::muted() const
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment