Fix nph and nt interderp

This commit is contained in:
RipleyTom 2023-12-22 08:25:04 +01:00 committed by Megamouse
parent 50214a6a07
commit 732d9b83ba
2 changed files with 8 additions and 4 deletions

View File

@ -59,8 +59,10 @@ lv2_socket_native::~lv2_socket_native()
if (bound_port)
{
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
nph.upnp_remove_port_mapping(bound_port, type == SYS_NET_SOCK_STREAM ? "TCP" : "UDP");
if (auto* nph = g_fxo->try_get<named_thread<np::np_handler>>())
{
nph->upnp_remove_port_mapping(bound_port, type == SYS_NET_SOCK_STREAM ? "TCP" : "UDP");
}
bound_port = 0;
}
}

View File

@ -91,8 +91,10 @@ nt_p2p_port::~nt_p2p_port()
#endif
}
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
nph.upnp_remove_port_mapping(port, "UDP");
if (auto* nph = g_fxo->try_get<named_thread<np::np_handler>>())
{
nph->upnp_remove_port_mapping(port, "UDP");
}
}
void nt_p2p_port::dump_packet(p2ps_encapsulated_tcp* tcph)