mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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: https://github.com/facebook/react-native/pull/24025 Differential Revision: D14536843 Pulled By: shergin fbshipit-source-id: 82a816e2c0afb5a6bb72637d7d55d6a4fda708af
This commit is contained in:
committed by
Facebook Github Bot
parent
e67aa427a8
commit
a98f342191
@@ -205,8 +205,6 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
||||
componentView:(UIView<RCTComponentViewProtocol> *)componentView
|
||||
{
|
||||
RCTAssertMainQueue();
|
||||
[componentView prepareForRecycle];
|
||||
|
||||
NSHashTable<UIView<RCTComponentViewProtocol> *> *componentViews =
|
||||
[_recyclePool objectForKey:(__bridge id)(void *)componentHandle];
|
||||
if (!componentViews) {
|
||||
@@ -218,6 +216,7 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
||||
return;
|
||||
}
|
||||
|
||||
[componentView prepareForRecycle];
|
||||
[componentViews addObject:componentView];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user