Commit 8804bf89 authored by Matěj Laitl's avatar Matěj Laitl
Browse files

playback: fix crash on quit in the middle of a fadeout

My assumption was incorrect, a child must still track its parent using
QWeakPointer to be safe.

Thanks for investigation from Harald Sitter, you were absolutely
correct, our lord-president. :)

BUG: 325723
FIXED-IN: 2.9
BACKPORT
parent 94a9d331
......@@ -15,6 +15,7 @@ VERSION 2.9-Beta 1
compilers currently supported by KDE.
BUGFIXES:
* Fix crash on quit when Amarok is in the middle of fadeout. (BR 325723)
* Prevent shared memory size errors for very large collections. (BR 327812)
* Fix OpenGL related crash. (BR 327150)
* Always show preview in Organize Files dialog, hide complicated options behind
......
......@@ -27,13 +27,13 @@ Fadeouter::Fadeouter( const QWeakPointer<Phonon::MediaObject> &media,
const QWeakPointer<Phonon::VolumeFaderEffect> &fader,
int fadeOutLength )
: QObject( fader.data() )
, m_fader( fader.data() )
, m_fader( fader )
{
Q_ASSERT( media );
Q_ASSERT( fader );
Q_ASSERT( fadeOutLength > 0 );
m_fader->fadeOut( fadeOutLength );
m_fader.data()->fadeOut( fadeOutLength );
// add a bit of a second so that the effect is not cut even if there are some delays
QTimer::singleShot( fadeOutLength + safetyDelay, this, SLOT(slotFinalizeFadeout()) );
......@@ -50,7 +50,7 @@ Fadeouter::~Fadeouter()
if( m_fader )
// warning: phonon-gstreamer bug 313551 (still present in 4.6.2) prevents
// following call to succeed if a fade is still in progress
m_fader->fadeIn( safetyDelay ); // fade-in, just in case, be nice to ears
m_fader.data()->fadeIn( safetyDelay ); // fade-in, just in case, be nice to ears
}
void
......
......@@ -64,7 +64,7 @@ class AMAROK_EXPORT Fadeouter : public QObject
void slotFinalizeFadeout();
private:
Phonon::VolumeFaderEffect *m_fader; // our parent, can never become null
QWeakPointer<Phonon::VolumeFaderEffect> m_fader;
};
#endif // FADEOUTER_H
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