Fix crash on undoing Tool by @shun-iwasawa

Port from OT
Co-Authored-By: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
This commit is contained in:
Artisteacher 2022-02-17 16:57:46 -05:00
parent 87c9c11faa
commit 78ba3b3fa5
2 changed files with 11 additions and 0 deletions

View file

@ -182,6 +182,8 @@ public:
.arg(QString::fromStdWString(m_level->getName()))
.arg(QString::number(m_frameId.getNumber()));
}
void onAdd() override;
};
//================================================================================================

View file

@ -605,7 +605,16 @@ void ToolUtils::TToolUndo::notifyImageChanged() const {
ImageManager::instance()->invalidate(id);
}
}
//------------------------------------------------------------------------------------------
void ToolUtils::TToolUndo::onAdd() {
// clean up the flags after registering undo
TTool::m_isLevelCreated = false;
TTool::m_isFrameCreated = false;
TTool::m_isLevelRenumbererd = false;
}
//------------------------------------------------------------------------------------------
int ToolUtils::TToolUndo::m_idCount = 0;
//================================================================================================