MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Clear

Method Clear

src/CacheDisk.cpp:364–384  ·  view source on GitHub ↗

Clear the cache of all frames

Source from the content-addressed store, hash-verified

362
363// Clear the cache of all frames
364void CacheDisk::Clear()
365{
366 // Create a scoped lock, to protect the cache from multiple threads
367 const std::lock_guard<std::recursive_mutex> lock(*cacheMutex);
368
369 // Clear all containers
370 frames.clear();
371 frame_numbers.clear();
372 frame_numbers.shrink_to_fit();
373 ordered_frame_numbers.clear();
374 ordered_frame_numbers.shrink_to_fit();
375 needs_range_processing = true;
376 frame_size_bytes = 0;
377
378 // Delete cache directory, and recreate it
379 QString current_path = path.path();
380 path.removeRecursively();
381
382 // Re-init folder
383 InitPath(current_path.toStdString());
384}
385
386// Count the frames in the queue
387int64_t CacheDisk::Count()

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected