mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:03:11 +08:00
Merge pull request #9829 from peppy/fix-multiple-assembly-loaded-crash
Fix crash when same ruleset loaded more than once
This commit is contained in:
commit
c86798f8b2
@ -191,6 +191,11 @@ namespace osu.Game.Rulesets
|
||||
if (loadedAssemblies.ContainsKey(assembly))
|
||||
return;
|
||||
|
||||
// the same assembly may be loaded twice in the same AppDomain (currently a thing in certain Rider versions https://youtrack.jetbrains.com/issue/RIDER-48799).
|
||||
// as a failsafe, also compare by FullName.
|
||||
if (loadedAssemblies.Any(a => a.Key.FullName == assembly.FullName))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
loadedAssemblies[assembly] = assembly.GetTypes().First(t => t.IsPublic && t.IsSubclassOf(typeof(Ruleset)));
|
||||
|
Loading…
Reference in New Issue
Block a user