Disconnect probe control in case source was destroyed.

Change-Id: Ibc4583af8acf7d28ee2504f246840a26e3a527be
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Lev Zelenskiy
2012-04-18 13:11:53 +10:00
committed by Qt by Nokia
parent c9749cf7ac
commit f1c4093f37
2 changed files with 16 additions and 0 deletions

View File

@@ -125,6 +125,14 @@ bool QAudioProbe::setSource(QMediaObject *source)
// 1) disconnect from current source if necessary
// 2) see if new one has the probe control
// 3) connect if so
// in case source was destroyed but probe control is still valid
if (!d->source && d->probee) {
disconnect(d->probee.data(), SIGNAL(audioBufferProbed(QAudioBuffer)), this, SIGNAL(audioBufferProbed(QAudioBuffer)));
disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
d->probee.clear();
}
if (source != d->source.data()) {
if (d->source) {
Q_ASSERT(d->probee);