During app startup, there appears to be an implicit call to set the Winforms threading model. This causes problems on Qt, which makes it's own call to set the threading model as part of app startup.
This adds a call to uninitialise the threading model at startup, ensuring that app-specific attempts to set the threading model
won't cause a crash.
This doesn't appear to impact the operation of the Crash Dialog, or Toga's own Dialog behaviour (Toga sets STA mode during app startup). The sample program provided by beeware/briefcase#930 also appears to work.
Also cleans up some environment management code that was raising warnings about using "unsafe" versions of methods.
Huge thanks to @davidfokkema for the leg work leading to this PR.
This could/should be backported to 0.3.12; it will also require retagging the app-template repository.
During app startup, there appears to be an implicit call to set the Winforms threading model. This causes problems on Qt, which makes it's own call to set the threading model as part of app startup.
This adds a call to uninitialise the threading model at startup, ensuring that app-specific attempts to set the threading model won't cause a crash.
This doesn't appear to impact the operation of the Crash Dialog, or Toga's own Dialog behaviour (Toga sets STA mode during app startup). The sample program provided by beeware/briefcase#930 also appears to work.
Also cleans up some environment management code that was raising warnings about using "unsafe" versions of methods.
Huge thanks to @davidfokkema for the leg work leading to this PR.
This could/should be backported to 0.3.12; it will also require retagging the app-template repository.
Fixes beeware/briefcase#930.
PR Checklist: