Replies: 1 comment
-
Thanks for the update! @MartinZikmund would you know why this is needed ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before I file a bug report, I want to see if Uno is behaving as intended and this should be a documented limitation instead.
There is a method similar to what is copied at the end below. This method is called whenever the application is Suspending. The purpose of this method is to save the application state to a working file for use at next startup.
The actual writing of the file is done using another thread in the 'session' which manages and runs all operations like this. Once the file is written to the stream, the given action (last parameter in SaveAsync(), is run as a callback. Within this callback action the deferral keeping the app alive is considered complete.
It is here that calling SuspendingDeferral.Complete() will crash the app
Of course the callback action will be run by the background thread that actually wrote the file to the stream. This is easily fixable by adding the below code. However, it isn't necessary on UWP as UWP allows the deferral to be used by background threads.
Example code:
Stack Trace
Beta Was this translation helpful? Give feedback.
All reactions