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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Playlist/PlaylistLoader.m

+3-1
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)