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

New commits:
commit a2e8e8f82449b3291c36537d92870f9c4a13ef9c
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Fri Mar 1 14:04:52 2019 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Mar 13 10:59:00 2019 +0100

    tdf#123745 vcl: fix some crash in Window::SetHelpHdl()
    
    Qt5 has some QEvent::DeferredDelete thing, perhaps that's why it calls
    this on a disposed Window?
    
    0 vcl::Window::SetHelpHdl(Link<vcl::Window&, bool> const&) (this=0x60cf9e0, 
rLink=...) at vcl/source/window/window.cxx:1825
    1 SalInstanceWindow::clear_child_help(vcl::Window*) (this=0x7fa40c0, 
pParent=0x60cf9e0) at vcl/source/app/salvtables.cxx:825
    2 SalInstanceWindow::~SalInstanceWindow() (this=0x7fa40c0, 
__in_chrg=<optimized out>, __vtt_parm=<optimized out>) at 
vcl/source/app/salvtables.cxx:962
    3 SalInstanceWindow::~SalInstanceWindow() (this=0x7fa40c0, 
__in_chrg=<optimized out>, __vtt_parm=<optimized out>) at 
vcl/source/app/salvtables.cxx:963
    4 std::default_delete<weld::Window>::operator()(weld::Window*) const 
(this=0x60d0b90, __ptr=0x7fa4190) at /usr/include/c++/8/bits/unique_ptr.h:81
    5 std::unique_ptr<weld::Window, std::default_delete<weld::Window> 
>::~unique_ptr() (this=0x60d0b90, __in_chrg=<optimized out>) at 
/usr/include/c++/8/bits/unique_ptr.h:274
    6 SalFrame::~SalFrame() (this=0x60d0b40, __in_chrg=<optimized out>) at 
vcl/source/app/salvtables.cxx:73
    7 Qt5Frame::~Qt5Frame() (this=0x60d0b30, __in_chrg=<optimized out>) at 
vcl/qt5/Qt5Frame.cxx:167
    8 KDE5SalFrame::~KDE5SalFrame() (this=0x60d0b30, __in_chrg=<optimized out>) 
at vcl/unx/kde5/KDE5SalFrame.hxx:34
    9 KDE5SalFrame::~KDE5SalFrame() (this=0x60d0b30, __in_chrg=<optimized out>) 
at vcl/unx/kde5/KDE5SalFrame.hxx:34
    10 QObject::event(QEvent*) (this=0x60d0b30, e=<optimized out>) at 
kernel/qobject.cpp:1242
    
    Change-Id: I2ac8cb24924ea3178c2b3eed14350515d8506ec3
    Reviewed-on: https://gerrit.libreoffice.org/68581
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
    Tested-by: Katarina Behrens <katarina.behr...@cib.de>
    (cherry picked from commit f8d98bcf37c790e4f02cbe19016b7f29f53e07ff)
    Reviewed-on: https://gerrit.libreoffice.org/69121
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    Reviewed-by: Xisco FaulĂ­ <xiscofa...@libreoffice.org>
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index aac1dc136a71..8df50b57da1f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1829,7 +1829,10 @@ void Window::LoseFocus()
 
 void Window::SetHelpHdl(const Link<vcl::Window&, bool>& rLink)
 {
-    mpWindowImpl->maHelpRequestHdl = rLink;
+    if (mpWindowImpl) // may be called after dispose
+    {
+        mpWindowImpl->maHelpRequestHdl = rLink;
+    }
 }
 
 void Window::RequestHelp( const HelpEvent& rHEvt )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to