diff options
-rw-r--r-- | src/cachemanager.cc | 9 |
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) { |