Draft
Conversation
vooon
reviewed
Nov 3, 2023
mavros/include/mavros/plugin.hpp
Outdated
|
|
||
| protected: | ||
| UASPtr uas; // uas back link | ||
| std::weak_ptr<UAS> uas_; // uas back link |
Author
There was a problem hiding this comment.
shared_ptr is not good here, because it creates cyclic references. The UAS node holds shared_ptrs to plugin nodes. In turn, each plugin node holds a shared_ptr to the UAS node. The result is that the UAS node and the plugin nodes never get destroyed.
You can check this by loading the mavros::uas::UAS component into a component container and then unloading it. The nodes will still be there. And then load it again, every node will get duplicated.
0d95358 to
98c538e
Compare
added 5 commits
June 25, 2024 20:27
- Removed unnecessary dynamic_pointer_cast<>'s Removed unused Plugin ctor
Prohibit copying and moving of UAS Removed startup_delay_timer
98c538e to
fe0e21d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.