Commit 30d5a943 authored by David Jarvie's avatar David Jarvie
Browse files

Bug 452962: Fix crash when Try clicked to stop audio alarm with fade

This implements a workaround for a Phonon crash where
~VolumeFaderEffect() called by ~MediaObject() crashes.
parent 56fc73ce
Pipeline #168383 passed with stage
in 3 minutes and 36 seconds
KAlarm Change Log
=== Version 3.4.1 (KDE Gear 22.04.1) --- 20 April 2022 ===
=== Version 3.4.1 (KDE Gear 22.04.1) --- 25 April 2022 ===
* Fix checkboxes being disabled in Preferences dialogue.
* Fix time spin boxes being displayed in the wrong position.
* Fix crash when Try clicked to stop audio alarm with fade [KDE Bug 452962]
=== Version 3.4.0 (KDE Gear 22.04) --- 6 April 2022 ===
* Allow calendars and date picker to be shown together in side panel [KDE Bug 440250]
......
......@@ -982,6 +982,17 @@ AudioPlayer::AudioPlayer(const QString& audioFile, float volume, float fadeVolum
AudioPlayer::~AudioPlayer()
{
qCDebug(KALARM_LOG) << "MessageDisplayHelper::~AudioPlayer";
// A bug in Phonon causes a crash when the VolumeFaderEffect is deleted due
// to being a child of MediaObject. This workaround prevents the crash by
// removing and deleting VolumeFaderEffect before ~MediaObject() is called.
const auto effects = mPath.effects();
for (Phonon::Effect* effect : effects)
{
mPath.removeEffect(effect);
delete effect;
}
// --- End of workaround for Phonon crash
delete mAudioObject;
mAudioObject = nullptr;
// Notify after deleting mAudioPlayer, so that isAudioPlaying() will
......
Supports Markdown
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