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

core: session: only create one session to access options when there's no current session #1565

Merged
merged 1 commit into from
May 30, 2023

Conversation

flit
Copy link
Member

@flit flit commented May 29, 2023

If Session.current_session is accessed without a valid current session, an empty Session is created and retained via a strong reference. This mostly happens when session options are read prior to the main session being created.

Since the ._current_session attribute is a weakref, the options session instance would previously be collected immediately after use, leading to repeated creation of options sessions in some cases.

… no current session

If Session.current_session is accessed without a valid current session,
an empty Session is created and retained via a strong reference. This
mostly happens when session options are read prior to the main session
being created.

Since the ._current_session attribute is a weakref, the options session
instance would previously be collected immediately after use, leading
to repeated creation of options sessions in some cases.
@flit flit merged commit 3ea6ec0 into pyocd:main May 30, 2023
@flit flit deleted the bugfix/repeated_session_load branch May 30, 2023 21:55
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