summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/source/uielement/generictoolbarcontroller.cxx5
1 files changed, 3 insertions, 2 deletions
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)