Skip to content

Commit

Permalink
Traversal on connect should be done on the main thread
Browse files Browse the repository at this point in the history
Summary:
^

Reference: https://fb.workplace.com/groups/flippersupport/permalink/1775903596223624/

Reviewed By: LukeDefeo

Differential Revision: D53471045

fbshipit-source-id: 551caca8b5210f8a5117d0dbffae800e46a93af3
  • Loading branch information
lblasa authored and facebook-github-bot committed Feb 6, 2024
1 parent 0ea70ef commit c66fa94
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c66fa94

Please sign in to comment.