Kaydet (Commit) 3430d2c2 authored tarafından Philippe Jung's avatar Philippe Jung Kaydeden (comit) Michael Meeks

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/15817Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 564fc483
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment