diff --git a/src/app/ui/editor/moving_cel_state.cpp b/src/app/ui/editor/moving_cel_state.cpp index 403dafe7b..5f33ebf83 100644 --- a/src/app/ui/editor/moving_cel_state.cpp +++ b/src/app/ui/editor/moving_cel_state.cpp @@ -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 diff --git a/src/app/ui/editor/moving_cel_state.h b/src/app/ui/editor/moving_cel_state.h index 52eeeb657..f0b0955f6 100644 --- a/src/app/ui/editor/moving_cel_state.h +++ b/src/app/ui/editor/moving_cel_state.h @@ -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