diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-17 17:02:58 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-18 09:13:56 +0100 |
commit | c48df7ad7d49ac093058ceb28d6d3f272f6e2e07 (patch) | |
tree | 57d09d39c327154bc99f40272cc80d3221cb8189 /sw/source | |
parent | 8020686ff93fc19c4089c66c1039d1239f33361f (diff) |
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
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 0bdcc0084d56..5b7a4a77190b 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( |