summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-17 17:02:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-03-17 17:02:58 +0100
commitddeeb49f365ce2144448f9d380c54b64fcb7b3fa (patch)
treecdbf1f14505eb374c1ce79d633ac98b52bb99b63
parentSwMMResultEmailDialog: disable from/to numeric fields by default (diff)
downloadcore-ddeeb49f365ce2144448f9d380c54b64fcb7b3fa.tar.gz
core-ddeeb49f365ce2144448f9d380c54b64fcb7b3fa.zip
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
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx3
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(