summaryrefslogtreecommitdiff
path: root/src/cachemanager.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2015-04-10 16:48:52 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2015-04-10 16:48:52 +0200
commit0f6c63ac08ed1a4e3977087cdc4cfec246ac3928 (patch)
treee389e9d3b4397a3163a5f106fde3da8e8ccf53b7 /src/cachemanager.cc
parent3fa874b20824d7bc61352f4f980114ba4a6399b6 (diff)
Added deinit() implementation. Fixed semicolon in typedef.
Diffstat (limited to 'src/cachemanager.cc')
-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)
{