From 0943adb2f7ec319891c11889b40c9a69f0d1027e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 12 Nov 2015 12:25:16 +0000 Subject: Resolves: tdf#95021 crash on closing macro dialog editor VclPtr related, dialog dtor is never called, so timer is never stopped and timer refers to deleted parent data Change-Id: I804ba082817802c0017e61c6b86c5d3694995ea8 --- basctl/source/basicide/baside3.cxx | 6 ++++++ basctl/source/inc/baside3.hxx | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 6b1edfbfc524..09e3c873dcd3 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -97,6 +97,12 @@ DialogWindow::DialogWindow(DialogWindowLayout* pParent, ScriptDocument const& rD SetReadOnly(true); } +void DialogWindow::dispose() +{ + pEditor.reset(); + BaseWindow::dispose(); +} + void DialogWindow::LoseFocus() { if ( IsModified() ) diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx index ebafb496eb1d..3ac12e1e3d8e 100644 --- a/basctl/source/inc/baside3.hxx +++ b/basctl/source/inc/baside3.hxx @@ -57,13 +57,14 @@ class DialogWindow: public BaseWindow { private: DialogWindowLayout& rLayout; - std::unique_ptr pEditor; // never nullptr + std::unique_ptr pEditor; std::unique_ptr pUndoMgr; // never nullptr OUString aCurPath; protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override; virtual void Resize() override; + virtual void dispose() override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; -- cgit v1.2.3