Skip to content

Use std::shared_ptr holder type for Destroyable subsclasses to keep grandparent wrapper instances alive#758

Closed
sloretz wants to merge 3 commits intomasterfrom
std_shared_ptr_holder_type_destroyable
Closed

Use std::shared_ptr holder type for Destroyable subsclasses to keep grandparent wrapper instances alive#758
sloretz wants to merge 3 commits intomasterfrom
std_shared_ptr_holder_type_destroyable

Conversation

@sloretz
Copy link
Copy Markdown
Contributor

@sloretz sloretz commented Apr 6, 2021

Part of #665 - alternative to #757

This makes Destroyable subclasses use the std::shared_ptr holder type and use shared_from this. This allows classes to keep the parent wrapper instance alive so that grandparent's are kept alive too.

Since clock has no grandparent types, there isn't actually an issue in master - it's not until #756 adds Publisher and Subscription that it becomes an issue.. Maybe it's fine to leave this as is, and include this fix via #757 to #756?

sloretz added 3 commits April 6, 2021 11:54
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
@sloretz sloretz requested review from ahcorde and hidmic April 6, 2021 19:08
@sloretz sloretz self-assigned this Apr 6, 2021
@sloretz sloretz changed the title Std shared ptr holder type destroyable Use std::shared_ptr holder type for Destroyable subsclasses to keep grandparent wrapper instances alive Apr 6, 2021
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Apr 6, 2021

Closing in favor of #757 which will hopefully be merged or included into #756

@sloretz sloretz closed this Apr 6, 2021
@sloretz sloretz deleted the std_shared_ptr_holder_type_destroyable branch April 6, 2021 21:18
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.

1 participant