save app ref
@@ -80,7 +80,8 @@ class Window:
def __init__(self, viewer, *, show: bool = True):
# create QApplication if it doesn't already exist
- get_app()
+ # note: the return value must be retained to prevent garbage collection
+ _ = get_app()
# Connect the Viewer and create the Main Window
self.qt_viewer = QtViewer(viewer)
