diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Observer/UIDTreeObserverManager.m b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Observer/UIDTreeObserverManager.m index aa1255e6ca1..0937c1f6827 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Observer/UIDTreeObserverManager.m +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Observer/UIDTreeObserverManager.m @@ -15,6 +15,7 @@ #import "UIDFrameScanEvent.h" #import "UIDInitEvent.h" #import "UIDJSONSerializer.h" +#import "UIDMainThread.h" #import "UIDMetadataRegister.h" #import "UIDMetadataUpdateEvent.h" #import "UIDPerfStatsEvent.h" @@ -170,12 +171,19 @@ - (void)startWithContext:(UIDContext*)context { root:root reportResult:reportResult]; }]; - UIApplication* application = _context.application; - if (application) { - [_rootObserver processNode:application - withSnapshot:YES - withContext:_context]; - } + + UIDRunBlockOnMainThreadAsync(^{ + UIDTreeObserverManager* strongSelf = weakSelf; + if (strongSelf == nil) { + return; + } + UIApplication* application = strongSelf->_context.application; + if (application) { + [strongSelf->_rootObserver processNode:application + withSnapshot:YES + withContext:strongSelf->_context]; + } + }); } - (void)stop {