From 859d2e8641592006e8529c9b2877534b709d7e18 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 10 Sep 2011 05:32:31 +0200 Subject: [PATCH] * Fixed crash in AudioEngine. --- src/libtomahawk/audio/audioengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/audio/audioengine.cpp b/src/libtomahawk/audio/audioengine.cpp index 4f7b4010d..ba4cfc89b 100644 --- a/src/libtomahawk/audio/audioengine.cpp +++ b/src/libtomahawk/audio/audioengine.cpp @@ -158,14 +158,17 @@ void AudioEngine::stop() { tDebug( LOGEXTRA ) << Q_FUNC_INFO; + if ( isStopped() ) + return; setState( Stopped ); m_mediaObject->stop(); if ( !m_playlist.isNull() ) m_playlist.data()->reset(); + if ( !m_currentTrack.isNull() ) + emit timerPercentage( ( (double)m_timeElapsed / (double)m_currentTrack->duration() ) * 100.0 ); - emit timerPercentage( ( (double)m_timeElapsed / (double)m_currentTrack->duration() ) * 100.0 ); emit stopped(); setCurrentTrack( Tomahawk::result_ptr() );