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-16 11:03:13 +0000
commit0cfaabfc9457d15c819811a10deaf00eaef0e260 (patch)
tree5d3fa5e14fafe69bdac86d260b32d4bee96ac0c0
parent976377ef41b4911b7c0c19e3e7481d42f86b050a (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 (cherry picked from commit aa35f2981334ba2e5aed4269fe851054bbc584dc) Reviewed-on: https://gerrit.libreoffice.org/26353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-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 5b7a4a77190b..01249920d212 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 );
}