SafeConnect double execution, stale connections, and SafeSlot override leakage#1244
SafeConnect double execution, stale connections, and SafeSlot override leakage#1244wyzula-jan wants to merge 1 commit into
Conversation
… SafeSlot override leakage
There was a problem hiding this comment.
Pull request overview
This pull request fixes lifecycle and call-semantics issues in the SafeConnect/SafeSlot utilities to prevent double slot execution, avoid accumulating stale Qt connections, and ensure per-call overrides don’t mutate decorator defaults.
Changes:
- Reworked
SafeConnectto invoke the target slot exactly once per signal emission (with payload), and to self-disconnect when the receiver/slot becomes stale. - Updated
SafeSlotto apply_override_slot_paramson a per-call basis via a merged copy, preventing persistent mutation of decorator defaults. - Added regression tests covering the above behaviors (single execution, stale connection cleanup, override leakage).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit_tests/test_error_utils.py | Adds regression tests for SafeConnect single-execution + stale-disconnect behavior, and SafeSlot per-call override behavior. |
| bec_widgets/utils/error_popups.py | Fixes SafeConnect wrapper semantics and adds self-disconnect on stale refs; fixes SafeSlot override leakage by using per-call merged params. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
Description
Fix issues with
SafeConnect, previously any SafeConnect slot would be executed twice and connections from the deleted widget would be still connected on Qt level.