Skip to content

Conversation

@kristjanvalur
Copy link
Contributor

@kristjanvalur kristjanvalur commented Sep 1, 2025

Runnint the unittests with PySide is sometimes prone to crashing (see #154)
This PR fixes the issues by making lifetime management more robust.

  • Timer and signaller objects are parented to the app, for lifetime management.
  • QSocketNotifiers are also parented to the app for lifetime management
  • QEventLoop.close() is made more robust:
    • The EventPoller is stopped.
    • objects get a .deleteLater() for tidyness in case the __app lives on
    • disconnect() calls are guarded against errors due to different bindings.

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/qasync
  __init__.py 387, 404
  _unix.py 91-106, 123-125, 129-132, 161, 181-182, 186-188, 191-192
  _windows.py
  tests
  test_qeventloop.py 947-956
Project Total  

This report was generated by python-coverage-comment-action

@kristjanvalur
Copy link
Contributor Author

It would appear that the Notifier implementation in _unix.py is not actually used, but I updated it to match the other never the less, in case it ever gets wired in.

@kristjanvalur kristjanvalur marked this pull request as ready for review September 3, 2025 15:22
@hosaka
Copy link
Collaborator

hosaka commented Sep 18, 2025

Hi @kristjanvalur, sorry about the delay. I went through your changes. We can probably improve the test coverage, but it's not critical. LGTM.

@hosaka hosaka merged commit e5f4214 into CabbageDevelopment:master Sep 18, 2025
74 checks passed
@kristjanvalur kristjanvalur deleted the robustify-pyside branch September 18, 2025 16:05
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.

2 participants