- if(audio_cache) { delete audio_cache; audio_cache = 0; }
- if(video_cache) { delete video_cache; video_cache = 0; }
- if(!audio_cache) audio_cache = new CICache(preferences);
- if(!video_cache) video_cache = new CICache(preferences);
+ cache_lock->lock("PlaybackEngine::create_cache");
+ if( audio_cache )
+ audio_cache->remove_user();
+ if( video_cache )
+ video_cache->remove_user();
+ audio_cache = new CICache(preferences);
+ video_cache = new CICache(preferences);
+ cache_lock->unlock();