Skip to content

Commit

Permalink
Merge pull request #138 from suzuryg/fix/en-us-locale-leakage
Browse files Browse the repository at this point in the history
fix: en_us locale causes leakage of ScriptableObject
  • Loading branch information
suzuryg committed May 22, 2024
2 parents 62c9eed + 21bcc4f commit c9e6d8c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class LocalizationSetting : IReadOnlyLocalizationSetting, ILocalizationSe

private Subject<LocalizationTable> _onTableChanged = new Subject<LocalizationTable>();

private static LocalizationTable en_us;

public LocalizationSetting()
{
var locale = GetLocale();
Expand Down Expand Up @@ -87,7 +89,9 @@ public static LocalizationTable GetTable(Locale locale)
else
{
// en_US has the table in source code, not asset.
return ScriptableObject.CreateInstance<LocalizationTable>();
en_us = en_us != null ? en_us : ScriptableObject.CreateInstance<LocalizationTable>();

return en_us;
}
}

Expand Down

0 comments on commit c9e6d8c

Please sign in to comment.