mirror of
https://github.com/vale981/rmview
synced 2025-03-04 16:51:38 -05:00
Garbage collect cloned frames on close
This commit is contained in:
parent
462d7deeb3
commit
bc7882fda9
1 changed files with 4 additions and 2 deletions
|
@ -41,7 +41,7 @@ class rMViewApp(QApplication):
|
|||
pen_size = 15
|
||||
trail = None # None: disabled, False: inactive, True: active
|
||||
|
||||
cloned_frames = []
|
||||
cloned_frames = set()
|
||||
|
||||
def __init__(self, args):
|
||||
super(rMViewApp, self).__init__(args)
|
||||
|
@ -425,10 +425,12 @@ class rMViewApp(QApplication):
|
|||
img = QPixmap.fromImage(img)
|
||||
img.detach()
|
||||
v = QtImageViewer()
|
||||
v.setAttribute(Qt.WA_DeleteOnClose)
|
||||
v.setImage(img)
|
||||
v.show()
|
||||
v.rotate(self.viewer._rotation)
|
||||
self.cloned_frames.append(v)
|
||||
self.cloned_frames.add(v)
|
||||
v.destroyed.connect(lambda: self.cloned_frames.discard(v))
|
||||
|
||||
@pyqtSlot()
|
||||
def toggleStreaming(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue