Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix nullptr of Level's Palette when getting icon of Column

Abel Youa9871564276b
diff --git a/toonz/sources/toonz/cleanuppopup.cpp b/toonz/sources/toonz/cleanuppopup.cpp
index 18869c31f..89c9c9c9a 100644
--- a/toonz/sources/toonz/cleanuppopup.cpp
+++ b/toonz/sources/toonz/cleanuppopup.cpp
@@ -723,12 +723,16 @@ bool CleanupPopup::analyzeCleanupList() {
lev->setPath(scannedPath, true);
lev->clearFrames();
lev->setType(OVL_XSHLEVEL); // OVL_XSHLEVEL
- lev->setPalette(0);
+
+ // change of CurrentLevelPalette would trigger the update of column icon
+ // (would use level's Palette)
+ // So we should reset currentLevelPalette first here(do disconnect), to avoid nullptr
if (lev == TApp::instance()->getCurrentLevel()->getLevel())
TApp::instance()
->getPaletteController()
->getCurrentLevelPalette()
->setPalette(0);
+ lev->setPalette(0);
lev->load();
int i, frameCount = lev->getFrameCount();