framework/source/uielement/generictoolbarcontroller.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 79e450749d58e21cad747592f49e505830184d74 Author: Maxim Monastirsky <momonas...@gmail.com> AuthorDate: Tue Sep 27 23:42:26 2022 +0300 Commit: Maxim Monastirsky <momonas...@gmail.com> CommitDate: Fri Sep 30 13:01:32 2022 +0200 tdf#151172 crash in notebookbar with extension enabled Change-Id: I60d777b27ffee095807490f4b181b1b08ed88462 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140683 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonas...@gmail.com> diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index f61a0d0150b9..1fd8998f0460 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -356,8 +356,9 @@ ImageOrientationController::ImageOrientationController(const Reference<XComponen void ImageOrientationController::dispose() { ToolboxController::dispose(); - if (!m_pToolbar) - VCLUnoHelper::GetWindow(getParent())->RemoveEventListener(LINK(this, ImageOrientationController, WindowEventListener)); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(getParent()); + if (pWindow) + pWindow->RemoveEventListener(LINK(this, ImageOrientationController, WindowEventListener)); } IMPL_LINK(ImageOrientationController, WindowEventListener, VclWindowEvent&, rWindowEvent, void)