clear unfinished frames on release preview

This commit is contained in:
shun-iwasawa 2023-04-26 12:47:53 +09:00 committed by manongjohn
parent 92163602e5
commit a581671c53
3 changed files with 17 additions and 1 deletions

View file

@ -1278,6 +1278,17 @@ bool Previewer::isFrameReady(int frame) const {
//-----------------------------------------------------------------------------
void Previewer::clearAllUnfinishedFrames() {
for (int f = 0; f < m_imp->m_pbStatus.size(); f++) {
if (m_imp->m_pbStatus[f] == FlipSlider::PBFrameStarted) {
m_imp->remove(f);
}
}
m_imp->updateProgressBarStatus();
}
//-----------------------------------------------------------------------------
bool Previewer::isActive() const { return !m_imp->m_listeners.empty(); }
//-----------------------------------------------------------------------------

View file

@ -88,6 +88,8 @@ public:
std::vector<UCHAR> &getProgressBarStatus() const;
void clearAllUnfinishedFrames();
private:
friend class Imp;
void emitStartedFrame(const TRenderPort::RenderData &renderData);

View file

@ -966,9 +966,12 @@ void SceneViewer::enablePreview(int previewMode) {
emit freezeStateChanged(false);
}
if (m_previewMode != NO_PREVIEW)
if (m_previewMode != NO_PREVIEW) {
Previewer::instance(m_previewMode == SUBCAMERA_PREVIEW)
->removeListener(this);
Previewer::instance(m_previewMode == SUBCAMERA_PREVIEW)
->clearAllUnfinishedFrames();
}
m_previewMode = previewMode;