Skip to content

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

C

Delay undo/redo while saving in progress

manongjohn084a5ed98aa7
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index 452487003..bd7a4efe6 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -934,6 +934,10 @@ Room *MainWindow::getCurrentRoom() const {
//-----------------------------------------------------------------------------
void MainWindow::onUndo() {
+ // Must wait for current save to finish, just in case
+ while (TApp::instance()->isSaveInProgress())
+ ;
+
ToolHandle *toolH = TApp::instance()->getCurrentTool();
// do not use undo if tool is currently in use
@@ -946,6 +950,10 @@ void MainWindow::onUndo() {
//-----------------------------------------------------------------------------
void MainWindow::onRedo() {
+ // Must wait for current save to finish, just in case
+ while (TApp::instance()->isSaveInProgress())
+ ;
+
bool ret = TUndoManager::manager()->redo();
if (!ret) DVGui::error(QObject::tr("No more Redo operations available."));
}