Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.8.0
-
None
-
CentOS7.1x64 (GStreamer_1.0 is used as QAudioDecoder backend)
Description
I have found that this custom function produce memory leak:
void readSoundRecord(const QString &_fileName, QAudioFormat &_format, QByteArray &_bytearray) { QAudioDecoder audiodecoder; connect(&audiodecoder, SIGNAL(error(QAudioDecoder::Error)), this, SLOT(audioDecoderError(QAudioDecoder::Error))); audiodecoder.setSourceFilename(_fileName); QEventLoop _el; connect(&audiodecoder, SIGNAL(finished()), &_el, SLOT(quit())); connect(&audiodecoder, SIGNAL(error(QAudioDecoder::Error)), &_el, SLOT(quit())); connect(&audiodecoder, &QAudioDecoder::bufferReady, [&audiodecoder, &_bytearray, &_format] () { QAudioBuffer _ab = audiodecoder.read(); _format = _ab.format(); _bytearray.append(QByteArray(_ab.constData<char>(),_ab.byteCount())); }); audiodecoder.start(); _el.exec(); }
this issue can be reproduced in CentOS7.1x64, in Windows all works fine (no leaks). So it seems that problem somwhere between QAudioDecoder and GStreamer_1.0.