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

New commits:
commit 0acf7ff1cf7a7b34f9e731e6152b6cefaa8826a1
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon May 15 13:33:11 2023 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue May 16 08:48:24 2023 +0200

    vcl: fix crash in Window::GetOutDev()
    
    Crashreport signature:
    
    program/libmergedlo.so
            rtl::Reference<vcl::WindowOutputDevice>::get() const
                    include/rtl/ref.hxx:208
    program/libmergedlo.so
            vcl::Window::GetOutDev()
                    vcl/source/window/window.cxx:574
    program/libswlo.so
            SwViewShell::ImplEndAction(bool)
                    sw/source/core/view/viewsh.cxx:294
    program/libswlo.so
            SwViewShell::EndAction(bool)
                    sw/inc/viewsh.hxx:611
    
    i.e. GetOutDev() is called on a disposed vcl::Window.
    
    Change-Id: I5b17225fced85c6804fc93fd12021c92966d3aa7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151763
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 4ce13d590fe2..965f8772c293 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -571,7 +571,7 @@ Window::~Window()
 
 ::OutputDevice* Window::GetOutDev()
 {
-    return mpWindowImpl->mxOutDev.get();
+    return mpWindowImpl ? mpWindowImpl->mxOutDev.get() : nullptr;
 }
 
 Color WindowOutputDevice::GetBackgroundColor() const

Reply via email to