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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Thu Jul 28 06:24:30 UTC 2016


 vcl/source/window/accessibility.cxx |    1 +
 vcl/source/window/stacking.cxx      |    2 +-
 vcl/source/window/window.cxx        |    2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit cec4c3c563c70d846f372966f22e431b6358cece
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Wed Jul 27 14:50:54 2016 +0200

    vcl: Guard against invalid states
    
    Got crashes here in 5.0, seem to be gone in master, but better be safe
    than sorry
    
    Change-Id: I434800f0e4a465233024b6a1ae1f48b010319f5c
    Reviewed-on: https://gerrit.libreoffice.org/27594
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 2b42c13..55c9d30 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -143,6 +143,7 @@ css::uno::Reference< css::accessibility::XAccessible > Window::CreateAccessible(
 
 void Window::SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& x )
 {
+    assert(mpWindowImpl);
     mpWindowImpl->mxAccessible = x;
 }
 
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index b1c54e5..019dc05 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -845,7 +845,7 @@ void Window::SetParent( vcl::Window* pNewParent )
     SAL_WARN_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" );
     SAL_WARN_IF( pNewParent == this, "vcl", "someone tried to reparent a window to itself" );
 
-    if( pNewParent == this )
+    if( !pNewParent || pNewParent == this )
         return;
 
     // check if the taskpanelist would change and move the window pointer accordingly
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 0de3312..f6d460d 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3143,6 +3143,8 @@ const OUString& Window::GetHelpText() const
 
 void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow  )
 {
+    assert(mpWindowImpl);
+
     // be safe against re-entrance: first clear the old ref, then assign the new one
     mpWindowImpl->mxWindowPeer.clear();
     mpWindowImpl->mxWindowPeer = xPeer;


More information about the Libreoffice-commits mailing list