Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MAVLink Passthrough unsubscription #741

Merged
merged 4 commits into from
May 8, 2019
Merged

Conversation

julianoes
Copy link
Collaborator

This fixes #740. For more details check commits messages.

Instead of always unregistering all handlers for a cookie, we would like
to be able to unregister single handlers.
The API docs say that nullptr can be used to unregister. Therefore, we
should not add nullptr to the mavlink handlers but unregister properly.
This resolves the case where an API user tries to unregister while still
in the callback. In that case the callback gets erased from the
mavlink_handler_table and this causes the caller's scope to be
destroyed. We can prevent this by copying callback and the message
argument and add it to the user callback queue. Presumably, this can
have performance implications but I think we want to make sure not to
crash first.
@julianoes julianoes merged commit 03d2698 into develop May 8, 2019
@julianoes julianoes deleted the fix-passthrough-unsub branch May 8, 2019 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAVLink Passthrough unsubscription not working
2 participants