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

Use reference counted ExchangeHandle instead of raw ExchangeContext pointer in PairingSession #32498

Open
pidarped opened this issue Mar 8, 2024 · 0 comments
Assignees

Comments

@pidarped
Copy link
Contributor

pidarped commented Mar 8, 2024

Feature description

The PairingSession class(from which CASESession and PASESession derive) keeps a pointer to the ExchangeContext object as a member. Since it is not automatically reference counted(without explicit Retain() and Release()), it can get release prematurely in certain flows(e.g., before PairingSession::Finish() if no Standalone Ack is expected from the last message sent).
Instead, if an ExchangeHandle is used, it is held until it is finally released in PairingSession::Clear(), when it is destroyed.

Platform

core

Platform Version(s)

No response

Anything else?

No response

@pidarped pidarped self-assigned this Mar 8, 2024
pidarped added a commit to pidarped/connectedhomeip that referenced this issue Mar 8, 2024
…airingSession.

This ensures that the ExchangeContext for the session is automatically
reference counted without explicit manual Retain() and Release() calls.
As a result, the ExchangeContext is held until PairingSession::Clear()
gets called that, in turn, calls ClearValue() on the Optional to
internally call Release() on the underlying target.

Fixes Issue project-chip#32498.
pidarped added a commit to pidarped/connectedhomeip that referenced this issue Mar 8, 2024
…airingSession.

This ensures that the ExchangeContext for the session is automatically
reference counted without explicit manual Retain() and Release() calls.
As a result, the ExchangeContext is held until PairingSession::Clear()
gets called that, in turn, calls ClearValue() on the Optional to
internally call Release() on the underlying target.

Fixes Issue project-chip#32498.
pidarped added a commit to pidarped/connectedhomeip that referenced this issue Mar 8, 2024
…airingSession.

This ensures that the ExchangeContext for the session is automatically
reference counted without explicit manual Retain() and Release() calls.
As a result, the ExchangeContext is held until PairingSession::Clear()
gets called that, in turn, calls ClearValue() on the Optional to
internally call Release() on the underlying target.

Fixes Issue project-chip#32498.
yufengwangca pushed a commit that referenced this issue Mar 11, 2024
…airingSession. (#32499)

This ensures that the ExchangeContext for the session is automatically
reference counted without explicit manual Retain() and Release() calls.
As a result, the ExchangeContext is held until PairingSession::Clear()
gets called that, in turn, calls ClearValue() on the Optional to
internally call Release() on the underlying target.

Fixes Issue #32498.
huangxuyong pushed a commit to huangxuyong/connectedhomeip that referenced this issue Mar 19, 2024
…airingSession. (project-chip#32499)

This ensures that the ExchangeContext for the session is automatically
reference counted without explicit manual Retain() and Release() calls.
As a result, the ExchangeContext is held until PairingSession::Clear()
gets called that, in turn, calls ClearValue() on the Optional to
internally call Release() on the underlying target.

Fixes Issue project-chip#32498.
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

No branches or pull requests

1 participant