From a3262821a2a66ed419b89c9b425733caf8dd1659 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 10 Apr 2015 16:48:52 +0200 Subject: Added deinit() implementation. Fixed semicolon in typedef. --- src/cachemanager.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3