Skip to content

Commit

Permalink
Adding lock around SetCache method, which causes some crashes. Detect…
Browse files Browse the repository at this point in the history
…ed in Sentry: OPENSHOT-1Q
  • Loading branch information
jonoomph committed Apr 19, 2023
1 parent f544d84 commit 7100dc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,9 @@ std::vector<Clip*> Timeline::find_intersecting_clips(int64_t requested_frame, in

// Set the cache object used by this reader
void Timeline::SetCache(CacheBase* new_cache) {
// Get lock (prevent getting frames while this happens)
const std::lock_guard<std::recursive_mutex> lock(getFrameMutex);

// Destroy previous cache (if managed by timeline)
if (managed_cache && final_cache) {
delete final_cache;
Expand Down

0 comments on commit 7100dc7

Please sign in to comment.