From 9ebeca59e76fb7997aa333abc547597a47486a01 Mon Sep 17 00:00:00 2001 From: Tommy Meisel Date: Mon, 5 Jan 2026 15:44:25 -0800 Subject: [PATCH] Add weak_ptr to NetworkInformation in SetupNetDetect --- lib/pal/posix/NetworkInformationImpl.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pal/posix/NetworkInformationImpl.mm b/lib/pal/posix/NetworkInformationImpl.mm index 67713d67d..24c7839eb 100644 --- a/lib/pal/posix/NetworkInformationImpl.mm +++ b/lib/pal/posix/NetworkInformationImpl.mm @@ -105,6 +105,8 @@ virtual NetworkCost GetNetworkCost() { if (@available(macOS 10.14, iOS 12.0, *)) { + auto weak_this = std::weak_ptr(shared_from_this()); + m_monitor = nw_path_monitor_create(); nw_path_monitor_set_queue(m_monitor, dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)); nw_path_monitor_set_update_handler(m_monitor, ^(nw_path_t path)