mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-25 10:43:46 +00:00
Fix a crash pressing (and keeping pressed) Ctrl+Z (Command+Z)
This tries to avoid calling onBeforeCommandExecution() after we are going to the previous state. This might be a problem on all states that are using a scoped_connection to disconnect from the app::Context signal in the destructor (instead of in the onBeforePopState). Something to fix next for all other states.
This commit is contained in:
parent
42201a4783
commit
5ba8cecdde
@ -130,6 +130,16 @@ MovingCelState::MovingCelState(Editor* editor,
|
||||
}
|
||||
}
|
||||
|
||||
MovingCelState::~MovingCelState()
|
||||
{
|
||||
m_ctxConn.disconnect();
|
||||
}
|
||||
|
||||
void MovingCelState::onBeforePopState(Editor* editor)
|
||||
{
|
||||
m_ctxConn.disconnect();
|
||||
}
|
||||
|
||||
bool MovingCelState::onMouseUp(Editor* editor, MouseMessage* msg)
|
||||
{
|
||||
Doc* document = editor->document();
|
||||
@ -357,4 +367,5 @@ void MovingCelState::onBeforeCommandExecution(CommandExecutionEvent& ev)
|
||||
}
|
||||
ev.cancel();
|
||||
}
|
||||
|
||||
} // namespace app
|
||||
|
@ -44,7 +44,9 @@ namespace app {
|
||||
ui::MouseMessage* msg,
|
||||
const HandleType handle,
|
||||
const MovingCelCollect& collect);
|
||||
~MovingCelState();
|
||||
|
||||
virtual void onBeforePopState(Editor* editor) override;
|
||||
virtual bool onMouseUp(Editor* editor, ui::MouseMessage* msg) override;
|
||||
virtual bool onMouseMove(Editor* editor, ui::MouseMessage* msg) override;
|
||||
virtual bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
||||
@ -72,7 +74,7 @@ namespace app {
|
||||
HandleType m_handle;
|
||||
Editor* m_editor;
|
||||
|
||||
obs::scoped_connection m_ctxConn;
|
||||
obs::connection m_ctxConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
Loading…
x
Reference in New Issue
Block a user