mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 20:15:11 +00:00
clear mCurrentActivity in onHostDestroy
Summary: It doesn't make sense to clear mCurrentActivity in onHostPause -- we're not going to leak a paused activity. Only keeping it around after onDestroy could lead to leaks. This allows us to check the source of lifecycle events and only send them if they come from the current activity (upcoming diff). Reviewed By: astreet Differential Revision: D3655370 fbshipit-source-id: f54b04a95c5c090636219832e63a348f3ae5a5c3
This commit is contained in:
parent
baf5a5b99a
commit
46dc46a3b3
@ -487,7 +487,6 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
||||
}
|
||||
|
||||
moveToBeforeResumeLifecycleState();
|
||||
mCurrentActivity = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,7 +178,6 @@ public class ReactContext extends ContextWrapper {
|
||||
for (LifecycleEventListener listener : mLifecycleEventListeners) {
|
||||
listener.onHostPause();
|
||||
}
|
||||
mCurrentActivity = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -189,6 +188,7 @@ public class ReactContext extends ContextWrapper {
|
||||
for (LifecycleEventListener listener : mLifecycleEventListeners) {
|
||||
listener.onHostDestroy();
|
||||
}
|
||||
mCurrentActivity = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user