From 14387a231048d5e4b01bdc114eb6c501153dee1a Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 16 Jan 2020 16:20:16 -0500 Subject: [PATCH] Ensure updates happen on main thread. --- platform-darwin/Source/MPAppDelegate_InApp.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform-darwin/Source/MPAppDelegate_InApp.m b/platform-darwin/Source/MPAppDelegate_InApp.m index e093b4ba..717d7c46 100644 --- a/platform-darwin/Source/MPAppDelegate_InApp.m +++ b/platform-darwin/Source/MPAppDelegate_InApp.m @@ -149,8 +149,10 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve products[product.productIdentifier] = product; self.products = products; - for (id productObserver in self.productObservers) - [productObserver updateWithProducts:self.products transactions:[self transactions]]; + PearlMainQueue( ^{ + for (id productObserver in self.productObservers) + [productObserver updateWithProducts:self.products transactions:[self transactions]]; + } ); } - (void)request:(SKRequest *)request didFailWithError:(NSError *)error {