MavlinkPassthrough unsubscribing

#1

The MavlinkPassthrough online documentation for subscribe_message_async indicates to call the method with nullptr to stop the subscription. However I’m finding that this does not seem to work and the subscribed callback continues to be called (and causes a crash if the subscribing object has gone out of scope).

From what I can tell from looking at the code, subscribe_message_async ends up calling SystemImpl::register_mavlink_message_handler, but that methods doesn’t actually remove the subscription callback.

Perhaps I’m doing it wrong or missing something so any insight is appreciated.
Thanks,

#2

Thanks for the report! This looks like a bug that we have to look into.

I’ve created an issue: https://github.com/Dronecode/DronecodeSDK/issues/740

#3

I would appreciate if you could test this fix:

#4

Awesome! Indeed, that seems to have fixed the problem.
Thanks for the quick response.

1 Like