Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Nov 26, 2024
1 parent 4d16aa4 commit d37f0c3
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/ui/ProcessTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def startGUIUpdate(self):
outputVideoWidth=self.outputVideoWidth,
)
self.workerThread.latestPreviewPixmap.connect(self.updateProcessTab)
self.workerThread.finished.connect(self.guiChangesOnRenderCompletion)
self.workerThread.finished.connect(self.workerThread.deleteLater)
self.workerThread.finished.connect(self.workerThread.quit)
self.workerThread.finished.connect(
Expand Down Expand Up @@ -384,12 +385,19 @@ def renderToPipeThread(self, backend: str, interpolateTimes: int, interpolateMod
log(str(textOutput))
self.onRenderCompletion()

def onRenderCompletion(self):
self.renderProcess.wait()
def guiChangesOnRenderCompletion(self):
# Have to swap the visibility of these here otherwise crash for some reason
hide_layout_widgets(self.parent.onRenderButtonsContiainer)
self.parent.startRenderButton.setVisible(True)
self.parent.startRenderButton.setEnabled(True)
self.parent.previewLabel.clear()
self.parent.startRenderButton.clicked.disconnect()
self.parent.startRenderButton.clicked.connect(self.parent.startRender)
self.parent.processSettingsContainer.setEnabled(True)
self.parent.startRenderButton.setVisible(True)

def onRenderCompletion(self):
self.renderProcess.wait()
# Have to swap the visibility of these here otherwise crash for some reason
if self.settings["discord_rich_presence"] == "True": # only close if it exists
self.discordRPC.closeRPC()
try:
Expand All @@ -398,13 +406,8 @@ def onRenderCompletion(self):
self.workerThread.wait()
except Exception:
pass # pass just incase internet error caused a skip
# reset image preview
self.parent.previewLabel.clear()
self.parent.startRenderButton.clicked.disconnect()

self.parent.startRenderButton.clicked.connect(self.parent.startRender)

self.parent.enableProcessPage()



def getRoundedPixmap(self, pixmap, corner_radius):
size = pixmap.size()
Expand Down

0 comments on commit d37f0c3

Please sign in to comment.