The screenshot preview window is stored as a single reference:
self._scr_win=w
Why this is a problem
The preview widget has no parent and only one stored reference.
If another screenshot is taken before the previous preview window is closed, the old reference is overwritten. That creates a risk that the previous window object can be garbage-collected while still visible.
Fix approach
Use a safer window-lifetime strategy, for example:
keep preview windows in a list
remove closed windows from that list
or guard against replacing a currently visible window
Status
Still open.
Not fixed in the current v0.2 working copy.
### Problem
The screenshot preview window is stored as a single reference:
```python
self._scr_win = w
```
### Why this is a problem
The preview widget has no parent and only one stored reference.
If another screenshot is taken before the previous preview window is closed, the old reference is overwritten. That creates a risk that the previous window object can be garbage-collected while still visible.
### Fix approach
Use a safer window-lifetime strategy, for example:
- keep preview windows in a list
- remove closed windows from that list
- or guard against replacing a currently visible window
### Status
Still open.
Not fixed in the current v0.2 working copy.
tgohle
self-assigned this 2026-04-17 12:09:17 +00:00
tgohle
changed title from Screenshot preview window lifetime handling is fragile to [Task]: Screenshot preview window lifetime handling is fragile2026-04-18 11:20:40 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The screenshot preview window is stored as a single reference:
Why this is a problem
The preview widget has no parent and only one stored reference.
If another screenshot is taken before the previous preview window is closed, the old reference is overwritten. That creates a risk that the previous window object can be garbage-collected while still visible.
Fix approach
Use a safer window-lifetime strategy, for example:
Status
Still open.
Not fixed in the current v0.2 working copy.
Screenshot preview window lifetime handling is fragileto [Task]: Screenshot preview window lifetime handling is fragile