Prevent using released unique_ptr
This commit is contained in:
parent
fa8e6a76db
commit
ce7595fd8a
|
@ -45,8 +45,9 @@ inline bool StackSupport::push(std::unique_ptr<CustomUndoCommand> command)
|
|||
if (command->isNoop()) {
|
||||
return true; // doing nothing can never fail
|
||||
}
|
||||
m_undoStack->push(command.release());
|
||||
return command->redoResult();
|
||||
auto *const rawCommand(command.release());
|
||||
m_undoStack->push(rawCommand);
|
||||
return rawCommand->redoResult();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in New Issue