From 0b45dc584f43d56d2ce6abefdc7e4be18bfd8702 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 1 Nov 2021 20:07:13 -0400 Subject: [PATCH] Fix deadlock when loadStore posts notifications to the main thread. --- platform-darwin/Source/iOS/MPiOSAppDelegate.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform-darwin/Source/iOS/MPiOSAppDelegate.m b/platform-darwin/Source/iOS/MPiOSAppDelegate.m index 0d8f07a6..165ebd5d 100644 --- a/platform-darwin/Source/iOS/MPiOSAppDelegate.m +++ b/platform-darwin/Source/iOS/MPiOSAppDelegate.m @@ -132,7 +132,9 @@ MP_LIBS_END [self updateConfigKey:note.object]; } ); PearlAddNotificationObserver( NSUserDefaultsDidChangeNotification, nil, nil, ^(id self, NSNotification *note) { - [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:nil]; + PearlMainQueueOperation( ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:nil]; + } ); } ); } @catch (id exception) {