summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-08-25 14:09:16 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-08-25 14:12:04 +0000
commitedc415be476c7ef59f00914b2a6dfc6896d7a34d (patch)
tree28d3fcb26755967d096bdcaf9654a4b26f164630
parent4eb4a3ada360af152b9403e8a88eb76b9474c4ba (diff)
downloadqtmultimedia-edc415be476c7ef59f00914b2a6dfc6896d7a34d.tar.gz
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>
-rw-r--r--src/multimedia/audio/qsoundeffect_qaudio_p.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
index c4776b32d..e95e4e521 100644
--- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
@@ -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),