MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / clearCache

Method clearCache

source/base/StarAssets.cpp:605–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605void Assets::clearCache() {
606 MutexLocker assetsLocker(m_assetsMutex);
607
608 // Clear all assets that are not queued or broken.
609 auto it = makeSMutableMapIterator(m_assetsCache);
610 while (it.hasNext()) {
611 auto const& pair = it.next();
612 // Don't clean up queued, persistent, or broken assets.
613 if (pair.second && !pair.second->shouldPersist() && !m_queue.contains(pair.first))
614 it.remove();
615 }
616}
617
618void Assets::cleanup() {
619 MutexLocker assetsLocker(m_assetsMutex);

Callers 1

fullyLoadMethod · 0.80

Calls 6

makeSMutableMapIteratorFunction · 0.85
shouldPersistMethod · 0.80
hasNextMethod · 0.45
nextMethod · 0.45
containsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected