Skip to content

Commit

Permalink
Fix incorrect unhooking for UI manager views in RCTProfileUnhookModul…
Browse files Browse the repository at this point in the history
…es (#25042)

Summary:
This PR fixes incorrect unhooking for UI manager views in `RCTProfileUnhookModules`. `view` is actually a key, not the view itself; instead, use `viewForReactTag:` to obtain the view itself.

This fixes issue #24952.

## Changelog

[iOS] [Fixed] - Fix incorrect unhooking for UI manager views in `RCTProfileUnhookModules`, causing an infinite `RCTProfileTrampoline ` recursion (#24952)
Pull Request resolved: #25042

Differential Revision: D15580978

Pulled By: PeteTheHeat

fbshipit-source-id: 3483a7f6380b6fb1db4249374d86f692348c9aa2
  • Loading branch information
LeoNatan authored and facebook-github-bot committed May 31, 2019
1 parent 62c605e commit 23f5787
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Profiler/RCTProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void RCTProfileUnhookModules(RCTBridge *bridge)
if ([bridge moduleIsInitialized:[RCTUIManager class]]) {
dispatch_async(dispatch_get_main_queue(), ^{
for (id view in [bridge.uiManager valueForKey:@"viewRegistry"]) {
RCTProfileUnhookInstance(view);
RCTProfileUnhookInstance([bridge.uiManager viewForReactTag:view]);
}

dispatch_group_leave(RCTProfileGetUnhookGroup());
Expand Down

0 comments on commit 23f5787

Please sign in to comment.