[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 12 17:46:23 UTC 2021


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

New commits:
commit a459c2f41a4c38fd79aa93995cc99ec6a506ce9d
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jul 9 15:14:50 2021 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jul 12 19:45:49 2021 +0200

    vcl: make get_id safe for disposed windows.
    
    crash from:
            findChild(vcl::Window*, rtl::OUString const&, bool)      include/rtl/ustring.hxx:1744
            WindowUIObject::get_visible_child(rtl::OUString const&)  /vcl/source/uitest/uiobject.cxx:463
            lcl_sendDialogEvent ...
    
    Change-Id: Ic1756c7b03f2dee9780fb1a735917f1d0fc11876
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118631
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ash at collabora.com>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b7f62400eb34..5b91cd0da1a7 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3939,7 +3939,8 @@ void Window::set_id(const OUString& rID)
 
 const OUString& Window::get_id() const
 {
-    return mpWindowImpl->maID;
+    static OUString empty;
+    return mpWindowImpl ? mpWindowImpl->maID : empty;
 }
 
 FactoryFunction Window::GetUITestFactory() const


More information about the Libreoffice-commits mailing list