Merge pull request #4261 from Atlante45/reverb_memory_leak

Reverb memory leak
This commit is contained in:
Brad Hefta-Gaub 2015-02-10 12:00:54 -08:00
commit cf5fb49562
3 changed files with 17 additions and 1 deletions

View file

@ -135,6 +135,15 @@ AudioClient::AudioClient() :
updateTimer->start(DEVICE_CHECK_INTERVAL_MSECS);
}
AudioClient::~AudioClient() {
if (_gverbLocal) {
gverb_free(_gverbLocal);
}
if (_gverb) {
gverb_free(_gverb);
}
}
void AudioClient::reset() {
_receivedAudioStream.reset();
_stats.reset();
@ -522,10 +531,17 @@ bool AudioClient::switchOutputToAudioDevice(const QString& outputDeviceName) {
void AudioClient::initGverb() {
// Initialize a new gverb instance
if (_gverbLocal) {
gverb_free(_gverbLocal);
}
_gverbLocal = gverb_new(_outputFormat.sampleRate(), _reverbOptions->getMaxRoomSize(), _reverbOptions->getRoomSize(),
_reverbOptions->getReverbTime(), _reverbOptions->getDamping(), _reverbOptions->getSpread(),
_reverbOptions->getInputBandwidth(), _reverbOptions->getEarlyLevel(),
_reverbOptions->getTailLevel());
if (_gverb) {
gverb_free(_gverb);
}
_gverb = gverb_new(_outputFormat.sampleRate(), _reverbOptions->getMaxRoomSize(), _reverbOptions->getRoomSize(),
_reverbOptions->getReverbTime(), _reverbOptions->getDamping(), _reverbOptions->getSpread(),
_reverbOptions->getInputBandwidth(), _reverbOptions->getEarlyLevel(),

View file

@ -186,6 +186,7 @@ signals:
protected:
AudioClient();
~AudioClient();
private:
void outputFormatChanged();

View file

@ -1166,7 +1166,6 @@ int matchTextureUVSetToAttributeChannel(const QString& texUVSetName, const QHash
FBXLight extractLight(const FBXNode& object) {
FBXLight light;
int unkwnon = 0;
foreach (const FBXNode& subobject, object.children) {
QString childname = QString(subobject.name);
if (subobject.name == "Properties70") {