summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-15 23:17:50 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-15 23:34:11 +0200
commitaa35f2981334ba2e5aed4269fe851054bbc584dc (patch)
tree861ebc7fd07711ba2174a4e712e3a4d975042638
parent60e75fb276778459f6055360646d879b8c615d83 (diff)
tdf#98797 sw: try to fix crash in SwMailDispatcherListener_Impl
Commit c48df7ad7d49ac093058ceb28d6d3f272f6e2e07 added a isDisposed() call in SwMailDispatcherListener_Impl::idle() and i can't see why that would not be necessary in the other functions that access m_pSendMailDialog if it is necessary in idle() - it's not obvious *why* it would be necessary in idle() in the first place but obviously i don't understand when SwSendMailDialog::dispose() is invoked (which is what deletes m_pStatus, dereferencing which the backtrace crashes). There is code in SwSendMailDialog::dispose() to handle the case that the xMailDispatcher thread is still running, and stop it without joining, which would obviously trigger this crash if it were ever executed. (Maybe i should actually try what happens at runtime, but these mail-merge dialogs are all scarily confusing.) Change-Id: I550f6107b064b0c97f3d33bed5bd3830fa2e86f4
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index b4414563b6eb..e176958d92a3 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -182,7 +182,8 @@ void SwMailDispatcherListener_Impl::mailDelivered(
uno::Reference< mail::XMailMessage> xMailMessage)
{
SolarMutexGuard aGuard;
- m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
+ if (!m_pSendMailDialog->isDisposed())
+ m_pSendMailDialog->DocumentSent( xMailMessage, true, nullptr );
DeleteAttachments( xMailMessage );
}
@@ -192,7 +193,8 @@ void SwMailDispatcherListener_Impl::mailDeliveryError(
const OUString& sErrorMessage)
{
SolarMutexGuard aGuard;
- m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
+ if (!m_pSendMailDialog->isDisposed())
+ m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage );
DeleteAttachments( xMailMessage );
}