summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-03-12 13:29:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-14 12:40:14 +0100
commitd7533fd9357ad9452ff094231307edd30da33a88 (patch)
tree2082ccdd2d2c330621fc3e9e237a5abd30087f8b
parent4bb51fef0a5da88a75d5ba593557367b990ccab5 (diff)
AVFoundation: Fix another crash when destroying a QMediaPlayer
We need to unload media before we delete the player. Task-number: QTBUG-37447 Change-Id: I09263214c425339c0d8c192091aeaa6e3fb5331f Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
index 9e0ac4f42..a73974ccd 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
@@ -404,6 +404,8 @@ static void *AVFMediaPlayerSessionObserverCurrentItemObservationContext = &AVFMe
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO;
#endif
+ [self unloadMedia];
+
if (m_player) {
[m_player removeObserver:self forKeyPath:AVF_CURRENT_ITEM_KEY];
[m_player removeObserver:self forKeyPath:AVF_RATE_KEY];
@@ -416,8 +418,6 @@ static void *AVFMediaPlayerSessionObserverCurrentItemObservationContext = &AVFMe
m_playerLayer = 0;
}
- [self unloadMedia];
-
if (m_URL) {
[m_URL release];
}