Fixed undo_database
This commit is contained in:
parent
631849e7cc
commit
e905534ea6
1 changed files with 6 additions and 2 deletions
|
|
@ -118,8 +118,6 @@ void undo_database::undo()
|
|||
_db.insert( std::move(*item.second) );
|
||||
|
||||
_stack.pop_back();
|
||||
if( _stack.empty() )
|
||||
_stack.emplace_back();
|
||||
enable();
|
||||
--_active_sessions;
|
||||
} FC_CAPTURE_AND_RETHROW() }
|
||||
|
|
@ -127,6 +125,12 @@ void undo_database::undo()
|
|||
void undo_database::merge()
|
||||
{
|
||||
FC_ASSERT( _active_sessions > 0 );
|
||||
if( _active_sessions == 1 && _stack.size() == 1 )
|
||||
{
|
||||
_stack.pop_back();
|
||||
--_active_sessions;
|
||||
return;
|
||||
}
|
||||
FC_ASSERT( _stack.size() >=2 );
|
||||
auto& state = _stack.back();
|
||||
auto& prev_state = _stack[_stack.size()-2];
|
||||
|
|
|
|||
Loading…
Reference in a new issue