Skip to content

moor isolate to work with windows #1292

Answered by simolus3
matthewkooshad asked this question in Q&A
Discussion options

You must be logged in to vote

You also need to call open.overrideFor(OperatingSystem.windows, openSQLiteOnWindows); on the background isolate. This is because Dart isolates don't share memory or global variables, so you need to re-initialize them on the background isolate if you're not using the defaults. The right place to put them is in _startBackground, before you're actually opening the database.

I'll change the documentation to include this information:

As the name implies, Dart isolates don't share memory. This means that global variables
and values accessible in one isolate may not be visible in a background isolate.

For instance, if you're using open.overrideFor from package:sqlite3, you need to do that
on th…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matthewkooshad
Comment options

Answer selected by matthewkooshad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants