Skip to content

No longer store strong references to parent object in guiHelper.BoxSizerHelper to decrease likelihood of circular references in NVDA's GUI#16079

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
lukaszgo1:boxSizerHelperWeakParent
Jan 23, 2024
Merged

Conversation

@lukaszgo1

Copy link
Copy Markdown
Contributor

Link to issue number:

Related to #16019

Summary of the issue:

BoxSizerHelper class stores a strong reference to its parent. When it is mistakenly assigned to a member of its parent a circular reference is created making it impossible for Python's garbage collector to destroy the dialog when it goes out of scope.

Description of user facing changes

Should not be noticeable.

Description of development approach

BoxSizerHelper now stores a weak reference to its parent.

Testing strategy:

Temporarily introduced a circular reference between the Add-on Store dialog and one of its sizer helpers - ensured the dialog can be garbage collected when closed.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

…zerHelper to decrease likelihood of circular references in NVDA's GUI
@lukaszgo1 lukaszgo1 requested a review from a team as a code owner January 22, 2024 11:57
@lukaszgo1 lukaszgo1 requested a review from seanbudd January 22, 2024 11:57
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 22, 2024

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lukaszgo1

@seanbudd seanbudd merged commit 1c59ac2 into nvaccess:master Jan 23, 2024
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Jan 23, 2024
@lukaszgo1 lukaszgo1 deleted the boxSizerHelperWeakParent branch January 23, 2024 10:20
Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this pull request Feb 15, 2024
…zerHelper to decrease likelihood of circular references in NVDA's GUI (nvaccess#16079)

Related to nvaccess#16019

Summary of the issue:
BoxSizerHelper class stores a strong reference to its parent. When it is mistakenly assigned to a member of its parent a circular reference is created making it impossible for Python's garbage collector to destroy the dialog when it goes out of scope.

Description of user facing changes
Should not be noticeable.

Description of development approach
BoxSizerHelper now stores a weak reference to its parent.
SaschaCowley pushed a commit to SaschaCowley/nvda that referenced this pull request Feb 27, 2024
…zerHelper to decrease likelihood of circular references in NVDA's GUI (nvaccess#16079)

Related to nvaccess#16019

Summary of the issue:
BoxSizerHelper class stores a strong reference to its parent. When it is mistakenly assigned to a member of its parent a circular reference is created making it impossible for Python's garbage collector to destroy the dialog when it goes out of scope.

Description of user facing changes
Should not be noticeable.

Description of development approach
BoxSizerHelper now stores a weak reference to its parent.
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
…zerHelper to decrease likelihood of circular references in NVDA's GUI (nvaccess#16079)

Related to nvaccess#16019

Summary of the issue:
BoxSizerHelper class stores a strong reference to its parent. When it is mistakenly assigned to a member of its parent a circular reference is created making it impossible for Python's garbage collector to destroy the dialog when it goes out of scope.

Description of user facing changes
Should not be noticeable.

Description of development approach
BoxSizerHelper now stores a weak reference to its parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants