Free d in QAudioBuffer &QAudioBuffer::operator =(const QAudioBuffer &).

Task-number: QTBUG-40571
Change-Id: Idc2dcc7d254873edda653b9c9eb8d88cbb91d4f6
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
Friedemann Kleint
2015-03-09 12:34:40 +01:00
parent f839f9e3eb
commit 7b2178768f

View File

@@ -264,6 +264,8 @@ QAudioBuffer::QAudioBuffer(int numFrames, const QAudioFormat &format, qint64 sta
QAudioBuffer &QAudioBuffer::operator =(const QAudioBuffer &other)
{
if (this->d != other.d) {
if (d)
d->deref();
d = QAudioBufferPrivate::acquire(other.d);
}
return *this;