Skip to content

Commit

Permalink
Word Export: prevent cross-thread exception
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mark-sil committed Oct 16, 2024
1 parent e0b03e3 commit f73d484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/xWorks/DictionaryExportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f73d484

Please sign in to comment.