sw/source/ui/dbui/mmoutputtypepage.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ddeeb49f365ce2144448f9d380c54b64fcb7b3fa
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Mar 17 17:02:58 2016 +0100

    SwMailDispatcherListener_Impl: guard against disposed m_pSendMailDialog
    
    SwSendMailDialog normally creates its SwMailDispatcherListener_Impl in
    SwSendMailDialog::SendMails(), and SwMailDispatcherListener_Impl has a
    reference to its parent.  Usually when the mail merge ends, the
    MailDispatcher thread invokes SwMailDispatcherListener_Impl::idle(), and
    that disables its parent dialog's stop button.
    
    However, once the mail merge ends, SwSendMailDialog also schedules a
    deletion of itself via SwSendMailDialog::RemoveThis(), and it may happen
    that by the time idle() is called, the dialog is already disposed.
    
    Fix the problem by only accessing the parent dialog if it's not disposed
    already.
    
    With this, we no longer crash from time to time when all mails are sent
    out.
    
    Change-Id: Ib36188b558e1b8a857462c26d49ff7ab1d29093a

diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx 
b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 0bdcc00..5b7a4a7 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -173,7 +173,8 @@ void SwMailDispatcherListener_Impl::stopped(
 void SwMailDispatcherListener_Impl::idle(::rtl::Reference<MailDispatcher> 
/*xMailDispatcher*/)
 {
     SolarMutexGuard aGuard;
-    m_pSendMailDialog->AllMailsSent();
+    if (!m_pSendMailDialog->isDisposed())
+        m_pSendMailDialog->AllMailsSent();
 }
 
 void SwMailDispatcherListener_Impl::mailDelivered(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to