Prevent using released unique_ptr

This commit is contained in:
Marius Kittler 2018-06-19 13:32:21 +02:00
parent fa8e6a76db
commit ce7595fd8a
1 changed files with 3 additions and 2 deletions

View File

@ -45,8 +45,9 @@ inline bool StackSupport::push(std::unique_ptr<CustomUndoCommand> command)
if (command->isNoop()) { if (command->isNoop()) {
return true; // doing nothing can never fail return true; // doing nothing can never fail
} }
m_undoStack->push(command.release()); auto *const rawCommand(command.release());
return command->redoResult(); m_undoStack->push(rawCommand);
return rawCommand->redoResult();
} }
/*! /*!