Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[shared_preferences] Allow getInstance() to be reentrant #1961

Merged
merged 5 commits into from
Aug 8, 2019
Merged

[shared_preferences] Allow getInstance() to be reentrant #1961

merged 5 commits into from
Aug 8, 2019

Conversation

mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Aug 8, 2019

This is not a breaking change.

The rationale is that some apps call SharedPreferences.getInstance() from multiple widgets. If these calls come back to back before the map definition manages to come back from native, you end up getting different instances of SharedPreferences which is very very bad.

@mehmetf mehmetf requested a review from collinjackson August 8, 2019 19:40
@collinjackson collinjackson changed the title Allow getInstance() of SharedPreferences to be reentrant [shared_preferences] Allow getInstance() to be reentrant Aug 8, 2019
Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you.

@mehmetf mehmetf merged commit 6deda07 into flutter:master Aug 8, 2019
@mehmetf mehmetf deleted the b78 branch August 8, 2019 20:39
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants