diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-03-29 13:55:24 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-03-29 15:52:12 (GMT) |
commit | 0c5524e73848b95276f13c384d2c711188936deb (patch) | |
tree | a77b125f23f5acfaeca73a383d2f96df746c405b | |
parent | 32a182c25104e6e49fc965a168957acff52a2b53 (diff) | |
download | Qt-0c5524e73848b95276f13c384d2c711188936deb.zip Qt-0c5524e73848b95276f13c384d2c711188936deb.tar.gz Qt-0c5524e73848b95276f13c384d2c711188936deb.tar.bz2 |
Fixed crash in Phonon MMF backend during application shutdown
During application shutdown, DsaVideoPlayer::handleVideoWindowChanged
is called. At this point, the application's main window has been closed
and therefore QApplication::activeWindow() returns 0. This leads to a
crash.
This patch ensures that a null return value from
QApplication::activeWindow(), and the resulting zero value of
DsaVideoPlayer::m_window, are handled gracefully.
Reviewed-by: Frans Englich
-rw-r--r-- | src/3rdparty/phonon/mmf/videoplayer_dsa.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp index 21cdb16..732d2d9 100644 --- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp @@ -162,7 +162,10 @@ void MMF::DsaVideoPlayer::prepareCompleted() void MMF::DsaVideoPlayer::handleVideoWindowChanged() { if (!m_window) { - m_window = QApplication::activeWindow()->effectiveWinId()->DrawableWindow(); + if (QWidget *window = QApplication::activeWindow()) + m_window = window->effectiveWinId()->DrawableWindow(); + else + m_window = 0; m_videoScreenRect = TRect(); } @@ -213,6 +216,9 @@ void MMF::DsaVideoPlayer::handleParametersChanged(VideoParameters parameters) TRACE_CONTEXT(DsaVideoPlayer::handleParametersChanged, EVideoInternal); TRACE_ENTRY_0(); + if (!m_window) + return; + #ifndef QT_NO_DEBUG getDsaRegion(m_wsSession, *m_window); #endif |