mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Add simple locking of resourceManagers dictionary for thread safety
This commit is contained in:
parent
31c8586dac
commit
e536f1ad6d
@ -31,6 +31,8 @@ namespace osu.Game.Localisation
|
||||
string ns = split[0];
|
||||
string key = split[1];
|
||||
|
||||
lock (resourceManagers)
|
||||
{
|
||||
if (!resourceManagers.TryGetValue(ns, out var manager))
|
||||
resourceManagers[ns] = manager = new ResourceManager(ns, GetType().Assembly);
|
||||
|
||||
@ -45,6 +47,7 @@ namespace osu.Game.Localisation
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Task<string> GetAsync(string lookup)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user