diff options
| author | Brianna Rainey | 2022-05-02 17:37:11 -0700 |
|---|---|---|
| committer | GitHub | 2022-05-02 17:37:11 -0700 |
| commit | b765295d9790c240473dbdccd5dc730f39c2a763 (patch) | |
| tree | af1776499661cbea87e65b03719fbe722391f23f /src/gui | |
| parent | 4c5aa37aa6f41d909153a2b7d522db6d7582659a (diff) | |
| parent | 6c3410da0b7fc39a9bc613c208b6e6cd3d3c6ed2 (diff) | |
Merge pull request #71 from djfun/fix-70
Fix #70 - Crash when exporting video in GUI mode
Diffstat (limited to 'src/gui')
| -rw-r--r-- | src/gui/mainwindow.py | 4 | ||||
| -rw-r--r-- | src/gui/preview_thread.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/mainwindow.py b/src/gui/mainwindow.py index f6de763..2bfc4e3 100644 --- a/src/gui/mainwindow.py +++ b/src/gui/mainwindow.py @@ -4,7 +4,7 @@ This shows a preview of the video being created and allows for saving projects and exporting the video at a later time. ''' -from PyQt5 import QtCore, QtGui, QtWidgets, uic +from PyQt5 import QtCore, QtWidgets, uic import PyQt5.QtWidgets as QtWidgets from PIL import Image from queue import Queue @@ -754,7 +754,7 @@ class MainWindow(QtWidgets.QMainWindow): self.autosave() self.updateWindowTitle() - @QtCore.pyqtSlot(QtGui.QImage) + @QtCore.pyqtSlot('QImage') def showPreviewImage(self, image): self.previewWindow.changePixmap(image) diff --git a/src/gui/preview_thread.py b/src/gui/preview_thread.py index 137864b..3943a5c 100644 --- a/src/gui/preview_thread.py +++ b/src/gui/preview_thread.py @@ -38,6 +38,7 @@ class Worker(QtCore.QObject): "components": components, } self.queue.put(dic) + log.debug('Preview thread id: {}'.format(int(QtCore.QThread.currentThreadId()))) @pyqtSlot() def process(self): @@ -79,6 +80,8 @@ class Worker(QtCore.QObject): except RuntimeError as e: log.error(str(e)) else: + # We must store a reference to this QImage + # or else Qt will garbage-collect it on the C++ side self.frame = ImageQt(frame) self.imageCreated.emit(QtGui.QImage(self.frame)) |
