You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mavsdk_server: fix crash on stop/destruction (mavlink#2417)
This fixes a segfault which happens when the mavsdk_server is stopped
and destroyed before every having discovered any autopilot.
What happened is that:
1. ConnectionInitiator would be cancelled.
2. ConnectionInitiator would be destructed.
3. And only now the connect thread would wake up from sleeping and read
the _should_exit flag which at this point has been destroyed.
At this point the connect function would try to access
Mavsdk::systems() which is also destructed by that point and cause a
segfault.
The fix is to wrap the ConnectionInitiator class in a shared ptr and
keep that one alive in the connect function to avoid destruction until
it has returned.
0 commit comments