From 2123ba02410cfa426f1b9791b4eed0db2fbae175 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Tue, 23 Aug 2022 15:39:52 +0900 Subject: [PATCH] fix crash on replacing level: --- toonz/sources/toonz/levelsettingspopup.cpp | 5 ++++- toonz/sources/toonz/previewfxmanager.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/toonz/sources/toonz/levelsettingspopup.cpp b/toonz/sources/toonz/levelsettingspopup.cpp index daa61b96..911d5abe 100644 --- a/toonz/sources/toonz/levelsettingspopup.cpp +++ b/toonz/sources/toonz/levelsettingspopup.cpp @@ -761,7 +761,7 @@ LevelSettingsValues LevelSettingsPopup::getValues(TXshLevelP level) { values.doAntialias = (sl->getProperties()->antialiasSoftness() > 0) ? Qt::Checked : Qt::Unchecked; - values.softness = sl->getProperties()->antialiasSoftness(); + values.softness = sl->getProperties()->antialiasSoftness(); } } @@ -1475,6 +1475,7 @@ void LevelSettingsPopup::onSubsamplingChanged() { return; } + bool somethingChanged = false; TUndoManager::manager()->beginBlock(); QSetIterator levelItr(m_selectedLevels); while (levelItr.hasNext()) { @@ -1491,8 +1492,10 @@ void LevelSettingsPopup::onSubsamplingChanged() { TUndoManager::manager()->add(new LevelSettingsUndo( levelP.getPointer(), LevelSettingsUndo::Subsampling, oldSubsampling, subsampling)); + somethingChanged = true; } TUndoManager::manager()->endBlock(); + if (!somethingChanged) return; TApp::instance()->getCurrentScene()->setDirtyFlag(true); TApp::instance() diff --git a/toonz/sources/toonz/previewfxmanager.cpp b/toonz/sources/toonz/previewfxmanager.cpp index ccffbfbc..169204a0 100644 --- a/toonz/sources/toonz/previewfxmanager.cpp +++ b/toonz/sources/toonz/previewfxmanager.cpp @@ -1456,6 +1456,7 @@ void PreviewFxManager::onLevelChanged() { // Build the level name as an alias keyword. All cache images associated // with an alias containing the level name will be updated. TXshLevel *xl = TApp::instance()->getCurrentLevel()->getLevel(); + if (!xl) return; std::string aliasKeyword; TFilePath fp = xl->getPath(); aliasKeyword = ::to_string(fp.withType(""));