Summary: | Amarok 2 suddenly crashed | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kdelibs | Reporter: | Sergei Andreev <seajey.serg> |
Component: | knotify | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | dev-kde, kfunk, yionel |
Priority: | NOR | ||
Version: | 4.3 | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Sergei Andreev
2010-01-28 22:19:07 UTC
@KNotify devs. Is this fixed in knotify from KDE4.4? I don't get these crashes here. Offending code: Meta::TrackPtr track = The::engineController()->currentTrack(); if( track ) { if( m_notify ) m_notify->close(); // Close old notification when switching quickly between tracks m_notify = new KNotification( "trackChange" ); if( track->album() ) m_notify->setPixmap( track->album()->imageWithBorder( 80 ) ); m_notify->setTitle( i18n( "Now playing" ) ); m_notify->setText( Amarok::prettyNowPlaying() ); m_notify->sendEvent(); } commit d9de1ba5b233c6d04fd779328e44659701607702 Author: Kevin Funk <krf@electrostorm.net> Date: Fri Jan 29 08:23:45 2010 +0100 A safer approach for closing the notification. Avoids dereferencing a dangling pointer. I don't get crashes anyway but this may fix it. BUG: 224673 diff --git a/ChangeLog b/ChangeLog index e2369d2..056a741 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,7 @@ VERSION 2.2.3 files which incorrectly have the same MusicBrainz unique identifier. BUGFIXES: + * Fixed crash in KNotify. (BR 224673) * Fixed queue management with mouse. (BR 217153) * Fixed playback of some streams causing the progress slider to show garbage track length and position values like -322:0-35:0-59. diff --git a/src/KNotificationBackend.cpp b/src/KNotificationBackend.cpp index d95b92e..f303d92 100644 --- a/src/KNotificationBackend.cpp +++ b/src/KNotificationBackend.cpp @@ -99,8 +99,10 @@ Amarok::KNotificationBackend::showCurrentTrack() // slot Meta::TrackPtr track = The::engineController()->currentTrack(); if( track ) { - if( m_notify ) - m_notify->close(); // Close old notification when switching quickly between tracks + if( m_notify ) { + delete m_notify; // Close old notification when switching quickly between tracks + m_notify = 0; + } m_notify = new KNotification( "trackChange" ); *** Bug 225674 has been marked as a duplicate of this bug. *** *** Bug 225901 has been marked as a duplicate of this bug. *** |