Skip to content

Commit 62824a9

Browse files
committed
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>
1 parent 903bc9c commit 62824a9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Playlist/PlaylistLoader.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,9 @@ - (void)loadInfoForEntries:(NSArray *)entries {
751751
});
752752
}
753753

754-
[playlistController commitPersistentStore];
754+
dispatch_sync_reentrant(dispatch_get_main_queue(), ^{
755+
[self->playlistController commitPersistentStore];
756+
});
755757

756758
[playlistController performSelectorOnMainThread:@selector(updateTotalTime) withObject:nil waitUntilDone:NO];
757759

0 commit comments

Comments
 (0)