From f73d4843b28972feeabfa9bdb47e74c802f9ba1c Mon Sep 17 00:00:00 2001 From: mark-sil Date: Wed, 16 Oct 2024 15:40:44 -0400 Subject: [PATCH] Word Export: prevent cross-thread exception When disposing the ClerkActivator do not update the status bar in the call to ActivateUI(). XHTML export is also calling this from a different thread but we were not seeing this error because the text string was the same as the current value so no change was made. Notes: In OnExport(), after the command completes, we call ActivateUI() a second time, and this time we do update the status bar. The exception was only happening when there were reversals and it seemed to only/mostly happen in debug builds. Change-Id: Ife8957181e5a07736b1f56e2f488aa92c8f226c5 --- Src/xWorks/DictionaryExportService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/xWorks/DictionaryExportService.cs b/Src/xWorks/DictionaryExportService.cs index 4fded0980d..10a47031d4 100644 --- a/Src/xWorks/DictionaryExportService.cs +++ b/Src/xWorks/DictionaryExportService.cs @@ -191,7 +191,7 @@ private void Dispose(bool disposing) { System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType() + " ******"); if (disposing && m_currentClerk != null && !m_currentClerk.IsDisposed) - m_currentClerk.ActivateUI(true); + m_currentClerk.ActivateUI(true, false); } ~ClerkActivator()