[Task]: Screenshot preview window lifetime handling is fragile #7

Open
opened 2026-04-17 11:31:40 +00:00 by tgohle · 0 comments
Owner

Problem

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 added the
area/screenshot
kind
task
3
severity
low
3
state
confirmed
2
labels 2026-04-17 11:45:35 +00:00
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 fragile 2026-04-18 11:20:40 +00:00
Sign in to join this conversation.
No description provided.