spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 7998fed49db3b0d6e49833216887dc4189da443b
parent 6cdfa4cfbba120c3b3763cbfc5b28809ab04ac2f
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed, 15 Jan 2014 17:46:08 -0800

Fix a memleak

Diffstat:
Msrc/spek-audio.cc | 6++++++
Msrc/spek-audio.h | 1+
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/spek-audio.cc b/src/spek-audio.cc @@ -89,6 +89,12 @@ Audio::Audio() av_register_all(); } +Audio::~Audio() +{ + // This prevents a memory leak. + av_lockmgr_register(nullptr); +} + std::unique_ptr<AudioFile> Audio::open(const std::string& file_name) { AudioError error = AudioError::OK; diff --git a/src/spek-audio.h b/src/spek-audio.h @@ -30,6 +30,7 @@ class Audio { public: Audio(); + ~Audio(); std::unique_ptr<AudioFile> open(const std::string& file_name); };