Serialize persistent store update to main thread

This needs to be called on the main thread, as something may or may not
be enumerating over the data while this thread decides to call it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-22 19:11:06 -07:00
parent 903bc9cba5
commit 62824a94bd
1 changed files with 3 additions and 1 deletions

View File

@ -751,7 +751,9 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
});
}
[playlistController commitPersistentStore];
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
[self->playlistController commitPersistentStore];
});
[playlistController performSelectorOnMainThread:@selector(updateTotalTime) withObject:nil waitUntilDone:NO];