mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-16 23:00:20 +08:00
fix memory leak
Summary: Signed-off-by: yk3372 <yk3372@gmail.com> What existing problem does the pull request solve? ViewManagersPropertyCache, ViewManagerPropertyUpdater static field not release when ReactInstanceManager called destroy. I use this url to integrate RN: [http://facebook.github.io/react-native/docs/integration-with-existing-apps.html](http://facebook.github.io/react-native/docs/integration-with-existing-apps.html) and in Activity's onDestroy function add the follow code to release RN: ```java mReactInstanceManager.destroy(); mReactInstanceManager = null; ``` and then when I exit activity, find the static field not release. the follow is screen shot: before:  after:  Closes https://github.com/facebook/react-native/pull/14172 Differential Revision: D5128834 Pulled By: javache fbshipit-source-id: 657763fa21fd8826b4060f9a17e7f35f0e1e04d3
This commit is contained in:
committed by
Facebook Github Bot
parent
7cddaa02d6
commit
9dc0385405
@@ -28,6 +28,11 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
private static final Map<Class, Map<String, PropSetter>> CLASS_PROPS_CACHE = new HashMap<>();
|
||||
private static final Map<String, PropSetter> EMPTY_PROPS_MAP = new HashMap<>();
|
||||
|
||||
public static void clear() {
|
||||
CLASS_PROPS_CACHE.clear();
|
||||
EMPTY_PROPS_MAP.clear();
|
||||
}
|
||||
|
||||
/*package*/ static abstract class PropSetter {
|
||||
|
||||
protected final String mPropName;
|
||||
|
||||
Reference in New Issue
Block a user