summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2015-04-10 16:48:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 13:22:07 +0100
commita3262821a2a66ed419b89c9b425733caf8dd1659 (patch)
tree96f99a0cb48709c16374b7232144fef97244fb02 /src
parent4c2ac6d7c5ba6b8eb3463d8e6c9373d68f379f03 (diff)
Added deinit() implementation. Fixed semicolon in typedef.
Diffstat (limited to 'src')
-rw-r--r--src/cachemanager.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cachemanager.cc b/src/cachemanager.cc
index 455b935..0ca8bb0 100644
--- a/src/cachemanager.cc
+++ b/src/cachemanager.cc
@@ -34,7 +34,7 @@ CacheManager::CacheManager()
CacheManager::~CacheManager()
{
- wait_stop();
+ deinit();
}
void CacheManager::init(int poolsize)
@@ -48,6 +48,13 @@ void CacheManager::init(int poolsize)
run();
}
+void CacheManager::deinit()
+{
+ if(!running) return;
+ running = false;
+ wait_stop();
+}
+
// Invariant: initial_samples_needed < preloaded audio data
sample_t *CacheManager::open(AudioFile *file, int initial_samples_needed, int channel, cacheid_t &id)
{