https://bugs.kde.org/show_bug.cgi?id=528695

--- Comment #3 from Yevhen Sidey <[email protected]> ---
Thanks for the quick MR (knotifications!219). I'm the reporter. Reading the
diff against current master, I see two problems:

1. `NotifyByAudio::finished()` has no argument, and the `connect()` lambdas
capture a raw `notification` with the plugin (`this`) as context object. Every
audio-only notification adds one more connection to the shared `m_audio`, and
none of them are ever disconnected. Any later sound finishing then calls
`finish(notification)` for all previously connected notifications, including
ones that are already closed and `deleteLater()`'d (autoDelete).
`KNotificationManager::notifyPluginFinished()` dereferences
`notification->id()`, so this looks like a use-after-free. It also closes
still-playing audio-only notifications early, whenever another sound ends.
Passing the id or notification in the signal (`finished(KNotification *)` /
`finished(quint32 id)`) and comparing, or using `notification` as the context
object, would avoid this.

2. The early-return paths in `NotifyByAudio::notify()` still never close the
notification: `!m_enabled` (sounds globally disabled), empty `Sound=`, no
canberra context, and `playSound()` failure ("Failed to play sound with
canberra: File or data not found"). My original case was the last one: the
`exitkde` sound is missing from the selected `freedesktop` theme. In that case
ksmserver would still wait the full 5 s. Emitting the "finished" in those paths
as well, or returning a status so NotifyByPopup/NotifyByPortal can `finish()`
immediately, would cover them.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to