Fix crash in QSoundEffect when using it from a non-GUI thread.

The internal QIODevice used as data source was not set as child of the
parent QSoundEffectPrivate. If moveToThread() was called on the
QSoundEffect, the QIODevice would still receive events on the main
thread, leading to race conditions.

Task-number: QTBUG-46359
Change-Id: I180da2fb498108b316fd9b5b5cc84376b360fa3f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
Yoann Lopes
2015-08-25 14:09:16 +02:00
parent 4eb4a3ada3
commit edc415be47

View File

@@ -297,6 +297,7 @@ void QSoundEffectPrivate::setCategory(const QString &category)
}
PrivateSoundSource::PrivateSoundSource(QSoundEffectPrivate* s):
QIODevice(s),
m_loopCount(1),
m_runningCount(0),
m_playing(false),