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>
This commit is contained in:
committed by
The Qt Project
parent
4bb51fef0a
commit
d7533fd935
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user