diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.cpp b/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.cpp index f5e95824412..4817e4d5757 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.cpp @@ -95,8 +95,10 @@ class HostTargetSession { // Owned by this instance, but shared (weakly) with the frontend channel std::shared_ptr remote_; FrontendChannel frontendChannel_; - HostAgent hostAgent_; SessionState state_; + + // NOTE: hostAgent_ has a raw reference to state_ so must be destroyed first. + HostAgent hostAgent_; }; std::shared_ptr HostTarget::create(