From 96521495f8c0070537be42c97f8fcbe55ec3990f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 31 Jul 2008 14:05:28 +0000 Subject: most love valgrind --- src/audio/buffers.cc | 2 ++ src/audio/pcm.cc | 13 ------------- src/audio/pcm.h | 5 ----- 3 files changed, 2 insertions(+), 18 deletions(-) (limited to 'src/audio') diff --git a/src/audio/buffers.cc b/src/audio/buffers.cc index dd83000..4e26c33 100644 --- a/src/audio/buffers.cc +++ b/src/audio/buffers.cc @@ -87,6 +87,8 @@ size_t Buffers::load(std::string name) registry[name] = id; index++; + delete pcm; + return id; } diff --git a/src/audio/pcm.cc b/src/audio/pcm.cc index b485199..7a3f767 100644 --- a/src/audio/pcm.cc +++ b/src/audio/pcm.cc @@ -33,17 +33,4 @@ void PCM::clear() memset(pcm_data, 0, pcm_size); } -void PCM::load(const char *name) -{ - PCM *pcm = Wav::load(name); - if (pcm) { - delete pcm; - } -} - -void PCM::load(std::string const & name) -{ - load(name.c_str()); -} - } diff --git a/src/audio/pcm.h b/src/audio/pcm.h index 740a23c..dc8eb16 100644 --- a/src/audio/pcm.h +++ b/src/audio/pcm.h @@ -38,11 +38,6 @@ public: /// number of channels inline unsigned int channels() const { return pcm_channels; } - /// load PCM audio data from file - static void load(std::string const & name); - - static void load(const char *name); - private: unsigned char *pcm_data; -- cgit v1.2.3