Skip to content

Commit a98f342

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Reorder prepareForRecycle before adding recycle pool (#24025)
Summary: Put `prepareForRecycle` to last before enqueue to recycle pool, ensure only call it when count lower than RCTComponentViewRegistryRecyclePoolMaxSize. cc. shergin . [General] [Changed] - Reorder prepareForRecycle before adding recycle pool Pull Request resolved: #24025 Differential Revision: D14536843 Pulled By: shergin fbshipit-source-id: 82a816e2c0afb5a6bb72637d7d55d6a4fda708af
1 parent e67aa42 commit a98f342

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

React/Fabric/Mounting/RCTComponentViewRegistry.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ - (void)_enqueueComponentViewWithComponentHandle:(ComponentHandle)componentHandl
205205
componentView:(UIView<RCTComponentViewProtocol> *)componentView
206206
{
207207
RCTAssertMainQueue();
208-
[componentView prepareForRecycle];
209-
210208
NSHashTable<UIView<RCTComponentViewProtocol> *> *componentViews =
211209
[_recyclePool objectForKey:(__bridge id)(void *)componentHandle];
212210
if (!componentViews) {
@@ -218,6 +216,7 @@ - (void)_enqueueComponentViewWithComponentHandle:(ComponentHandle)componentHandl
218216
return;
219217
}
220218

219+
[componentView prepareForRecycle];
221220
[componentViews addObject:componentView];
222221
}
223222

0 commit comments

Comments
 (0)