[Libreoffice-commits] core.git: vcl/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 14 13:52:15 UTC 2016


 vcl/source/window/toolbox2.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 3630f38227bd1398d351f6f3f4465229d1bfcddf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 15:43:16 2016 +0200

    Avoid null ToolBox::mpData deref during Frame::close
    
    Oh my, whatever the true cause for this SEGV in JunitTest_framework_complex (but
    probably the same cause as in previous 7f863e890640d0924a6e6f85cf99447dcd7836f7 "Avoid null ToolBox::mpData deref during Frame::close"),
    <http://ci.libreoffice.org/job/lo_tb_master_linux_dbg/6652/console>, processing
    an incoming URP request
    
    > ToolBox::SetDropdownClickHdl(Link<ToolBox*, void> const&) at vcl/source/window/toolbox2.cxx:1735
    > framework::ToolBarManager::Destroy() at framework/source/uielement/toolbarmanager.cxx:232
    > framework::ToolBarManager::dispose() at framework/source/uielement/toolbarmanager.cxx:473
    > framework::ToolBarWrapper::dispose() at framework/source/uielement/toolbarwrapper.cxx:106
    > framework::ToolbarLayoutManager::destroyToolbars() at framework/source/layoutmanager/toolbarlayoutmanager.cxx:654
    > framework::ToolbarLayoutManager::reset() at framework/source/layoutmanager/toolbarlayoutmanager.cxx:363
    > framework::LayoutManager::implts_reset(bool) at framework/source/layoutmanager/layoutmanager.cxx:413
    > framework::LayoutManager::frameAction(com::sun::star::frame::FrameActionEvent const&) at framework/source/layoutmanager/layoutmanager.cxx:2816
    > (anonymous namespace)::Frame::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&) at framework/source/services/frame.cxx:2953
    > (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) at framework/source/services/frame.cxx:1449
    > (anonymous namespace)::Frame::close(sal_Bool) at framework/source/services/frame.cxx:1689
    > framework::Desktop::impl_closeFrames(bool) at framework/source/services/desktop.cxx:1674
    > framework::Desktop::terminate() at framework/source/services/desktop.cxx:238
    
    and the main thread idling in Application::Yield.
    
    (ToolBox::SetDropdownClickHdl happens to be the only one among the
    pToolBar->Set*Hdl(...) functions called en bloc in ToolBarManager::Destroy that
    dereferences mpData.)
    
    Change-Id: I2c54f5deb5e132b25e577d4092d65e2069affb3e

diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 2d1294c..83a5176 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1732,7 +1732,9 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
 
 void ToolBox::SetDropdownClickHdl( const Link<ToolBox *, void>& rLink )
 {
-    mpData->maDropdownClickHdl = rLink;
+    if (mpData != nullptr) {
+        mpData->maDropdownClickHdl = rLink;
+    }
 }
 
 void ToolBox::SetMenuType( sal_uInt16 aType )


More information about the Libreoffice-commits mailing list