Skip to content

Commit 9ebeca5

Browse files
Add weak_ptr to NetworkInformation in SetupNetDetect
1 parent 5cac093 commit 9ebeca5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/pal/posix/NetworkInformationImpl.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ virtual NetworkCost GetNetworkCost()
105105
{
106106
if (@available(macOS 10.14, iOS 12.0, *))
107107
{
108+
auto weak_this = std::weak_ptr<NetworkInformation>(shared_from_this());
109+
108110
m_monitor = nw_path_monitor_create();
109111
nw_path_monitor_set_queue(m_monitor, dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0));
110112
nw_path_monitor_set_update_handler(m_monitor, ^(nw_path_t path)

0 commit comments

Comments
 (0)