mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
During the destruction of NearbyConnections, Core (which owns ClientProxy) is destructed before ServiceController (which owns EndpointManager), which means any pending tasks on the EndpointManager executor that use ClientProxy will be using garbage memory. To fix this issue, EndpointManager::DiscardEndpoint will check for an `is_shutdown` boolean set during ~EndpointManager before accessing ClientProxy. The assumption is that any accessing of ClientProxy after the destruction will be invalid. PiperOrigin-RevId: 532581122