diff options
author | Philippe Jung <phil.jung@free.fr> | 2015-05-19 18:32:21 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-19 20:16:56 +0000 |
commit | 3430d2c2b2c4e24b2757015addada9256e399012 (patch) | |
tree | 5f53355b8e6c1b7386dce9d9f78402b58881ce75 /svx/source/sidebar/tools/Popup.cxx | |
parent | 564fc483931c0aa2872a33023473c7ac36bfedf1 (diff) |
tdf#91382 UI: Crash after visiting Sidebar Properties Page
When a popup is displayed, no cleaning / disposing is performed.
Change-Id: Ibae0f977360f8862f2d7ff4c753356975dec3771
Reviewed-on: https://gerrit.libreoffice.org/15817
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svx/source/sidebar/tools/Popup.cxx')
-rw-r--r-- | svx/source/sidebar/tools/Popup.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx index 193bf85f783f..71911a51ae72 100644 --- a/svx/source/sidebar/tools/Popup.cxx +++ b/svx/source/sidebar/tools/Popup.cxx @@ -42,8 +42,8 @@ Popup::Popup ( Popup::~Popup() { - mxControl.reset(); - mxContainer.reset(); + mxControl.disposeAndClear(); + mxContainer.disposeAndClear(); } void Popup::Show (ToolBox& rToolBox) @@ -103,12 +103,16 @@ void Popup::ProvideContainerAndControl() void Popup::CreateContainerAndControl() { - mxContainer.reset(VclPtr<PopupContainer>::Create(mpParent)); + // Clean previous components, if any + mxControl.disposeAndClear(); + mxContainer.disposeAndClear(); + + mxContainer.set(VclPtr<PopupContainer>::Create(mpParent)); mxContainer->SetAccessibleName(msAccessibleName); mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); mxContainer->SetBorderStyle(mxContainer->GetBorderStyle() | WindowBorderStyle::MENU); - mxControl.reset(maControlCreator(mxContainer.get())); + mxControl.set(maControlCreator(mxContainer.get())); } IMPL_LINK_NOARG(Popup, PopupModeEndHandler) @@ -117,8 +121,8 @@ IMPL_LINK_NOARG(Popup, PopupModeEndHandler) maPopupModeEndCallback(); // Popup control is no longer needed and can be destroyed. - mxControl.reset(); - mxContainer.reset(); + mxControl.disposeAndClear(); + mxContainer.disposeAndClear(); return 0; } |