Skip to content

Commit

Permalink
Fix ObjectDisposedException when loading non-disc rom into Libretro
Browse files Browse the repository at this point in the history
fixes d9da3cf
  • Loading branch information
YoshiRulz committed Jan 10, 2025
1 parent 6adab25 commit 4aa3342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BizHawk.Client.Common/RomLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public bool LoadRom(string path, CoreComm nextComm, string launchLibretroCore, s
var ext = file.Extension;
var gi = Disc.IsValidExtension(ext)
? MakeGameFromDisc(InstantiateDiscFor(path), ext: ext, name: Path.GetFileNameWithoutExtension(file.Name))
: new RomGame(file).GameInfo;
: new RomGame(new(file.CanonicalFullPath)).GameInfo; // need to re-open???

This comment has been minimized.

Copy link
@CasualPokePlayer

CasualPokePlayer Jan 10, 2025

Member

I assume Dispose() call is happening with ReadAllBytes()

using var stream = GetStream();
(probably a bug?)

This comment has been minimized.

Copy link
@YoshiRulz

YoshiRulz Jan 10, 2025

Author Member

Well it's been that way since it was added in (ironically enough Libretro-related) 7651f41.

I suppose it could seek instead of close, but I ain't touching it.

Game.Name = $"{gi.Name} [{Game.Name/* core name */}]";
}
}
Expand Down

0 comments on commit 4aa3342

Please sign in to comment.