-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Word Export: prevent cross-thread exception #184
base: release/9.1
Are you sure you want to change the base?
Conversation
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
So if this is an exception that is happening because it is trying to modify winforms UI code from a different thread there is a more robust solution closer to where the control is modified. Every control has an InvokeRequired property that tells you if you are trying to execute something on the wrong thread. You can then use an Invoke method to get it to execute the code you want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets look at another option first.
Reviewable status: 0 of 1 files reviewed, all discussions resolved
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
This change is