Skip to content

Avoid circular reference on IOBase#14605

Merged
michaelDCurran merged 1 commit into
nvaccess:masterfrom
LeonarddeR:fixHwioGarbage
Feb 1, 2023
Merged

Avoid circular reference on IOBase#14605
michaelDCurran merged 1 commit into
nvaccess:masterfrom
LeonarddeR:fixHwioGarbage

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

None

Summary of the issue:

It is possible to register a callback on hwIo.IoBase to catch read errors. However, if this is a callback on a driver and the driver closes the device, the device keeps a reference to the callback on the driver. This causes a circular reference.

Description of user facing changes

Possibly less unreachable object errors

Description of development approach

Similar to _onReceive, ensure that onReadError is set to None when closing the device.

Testing strategy:

Tested locally with a driver providing an onReadError callback, ensured that the garbage collector could correctly cleanup resources.

Known issues with pull request:

None known

Change log entries:

This was only noticeable in the log, it is not user visible.

Code Review Checklist:

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

@LeonarddeR LeonarddeR requested a review from a team as a code owner February 1, 2023 14:06
@michaelDCurran michaelDCurran merged commit ffc91db into nvaccess:master Feb 1, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Feb 1, 2023
@LeonarddeR LeonarddeR deleted the fixHwioGarbage branch August 23, 2025 06:27
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.

3 participants