You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize a "main thread" realm instance in my app constructor and use it across my app (in the main thread).
There were no issues with that code until the NuGet version 5.x - it worked fine in 4.3.0.
Having a static realm instance like this makes it much easier for me to work with Realm in various app pages as well as in the app background task
Expected Results
No crash
Actual Results
When trying to access the realm instance: System.Exception: 'Realm accessed from incorrect thread.'
Steps to Reproduce
Realm.GetInstance() in app constructor realm.Write() later on in MainPage
That's an annoying implementation detail in the way UWP/WPF installs the synchronization context on the main thread. We special cased it for WPF, but seems like we'll need it for UWP too.
This has been fixed and will be released with the next Realm version. If you want to give it a shot, check out the nightly builds section of the readme on how to get the latest build from master (I just merged the PR, so it should be up in the packages section in ~20-30 minutes).
Goals
Initialize a "main thread" realm instance in my app constructor and use it across my app (in the main thread).
There were no issues with that code until the NuGet version 5.x - it worked fine in 4.3.0.
Having a static realm instance like this makes it much easier for me to work with Realm in various app pages as well as in the app background task
Expected Results
No crash
Actual Results
When trying to access the realm instance:
System.Exception: 'Realm accessed from incorrect thread.'
Steps to Reproduce
Realm.GetInstance()
in app constructorrealm.Write()
later on in MainPageCode Sample
RealmCrash.zip
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: