Skip to content

Commit

Permalink
App: [skip ci] fix printing warning for recursive calls of Document::…
Browse files Browse the repository at this point in the history
…_commitTransaction
  • Loading branch information
wwmayer committed Oct 23, 2020
1 parent cda1205 commit 73ba306
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/App/Document.cpp
Expand Up @@ -1218,11 +1218,16 @@ void Document::commitTransaction() {

void Document::_commitTransaction(bool notify)
{
if(isPerformingTransaction() || d->committing) {
if (isPerformingTransaction()) {
if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG))
FC_WARN("Cannot commit transaction while transacting");
return;
}
else if (d->committing) {
// for a recursive call return without printing a warning
return;
}

if (d->activeUndoTransaction) {
Base::FlagToggler<> flag(d->committing);
Application::TransactionSignaller signaller(false,true);
Expand All @@ -1237,7 +1242,8 @@ void Document::_commitTransaction(bool notify)
}
signalCommitTransaction(*this);

if(notify)
// closeActiveTransaction() may call again _commitTransaction()
if (notify)
GetApplication().closeActiveTransaction(false,id);
}
}
Expand Down

0 comments on commit 73ba306

Please sign in to comment.