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

Make ReadClient destructor clean up properly. #21658

Closed
bzbarsky-apple opened this issue Aug 5, 2022 · 0 comments · Fixed by #21660
Closed

Make ReadClient destructor clean up properly. #21658

bzbarsky-apple opened this issue Aug 5, 2022 · 0 comments · Fixed by #21660

Comments

@bzbarsky-apple
Copy link
Contributor

bzbarsky-apple commented Aug 5, 2022

Problem

Just destroying a ReadClient (e.g. from a subscription) does not handle cleaning up properly. In particular, for a subscription that does resubscribes it does not clean up the paths.

Proposed Solution

Fix things to work correctly.

@bzbarsky-apple bzbarsky-apple changed the title Make ReadClient destructor close it properly. Make ReadClient destructor clean up properly. Aug 5, 2022
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 5, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 5, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 5, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 5, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
woody-apple pushed a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 10, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
woody-apple pushed a commit that referenced this issue Aug 16, 2022
This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes #21658
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this issue Sep 16, 2022
…p#21660)

This is actually somewhat dangerous, because there is a good chance ~ReadClient
is running from under the destructor of the ReadClient::Callback and we are
invoking a virtual method on the callback.  But this is the only way to ensure
we don't leak.  ReadClient::Callback implementations need to be able to handle
this.

Fixes project-chip#21658
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 a pull request may close this issue.

1 participant