mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Release PerfMetricsBinding to avoid memory leak (#53420)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53420 # Changelog: [Internal] HostRuntimeBinding owns a connection, which is stored as a session on HostTarget, so we need to release it first in order to satifsy the assertion in the destructor. Reviewed By: huntie Differential Revision: D80778273 fbshipit-source-id: be7bf085fadd8808fd5e5c621c3990a5e7e0186d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8d8245123e
commit
4b34be445d
@@ -220,6 +220,11 @@ HostTarget::~HostTarget() {
|
||||
// HostCommandSender owns a session, so we must release it for the assertion
|
||||
// below to be valid.
|
||||
commandSender_.reset();
|
||||
|
||||
// HostRuntimeBinding owns a connection, so we must release it for the
|
||||
// assertion
|
||||
perfMetricsBinding_.reset();
|
||||
|
||||
// Sessions are owned by InspectorPackagerConnection, not by HostTarget, but
|
||||
// they hold a HostTarget& that we must guarantee is valid.
|
||||
assert(
|
||||
|
||||
Reference in New Issue
Block a user