1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:03:11 +08:00

dispose the streams

This commit is contained in:
OliBomby 2023-07-12 15:18:16 +02:00
parent 3052c317e1
commit 8ca801a224

View File

@ -432,10 +432,15 @@ namespace osu.Game.Beatmaps
if (file == null)
continue;
var beatmapContent = new LegacyBeatmapDecoder().Decode(new LineBufferedReader(RealmFileStore.Storage.GetStream(file.File.GetStoragePath())));
using var contentStream = RealmFileStore.Storage.GetStream(file.File.GetStoragePath());
using var contentStreamReader = new LineBufferedReader(contentStream);
var beatmapContent = new LegacyBeatmapDecoder().Decode(contentStreamReader);
using var skinStream = RealmFileStore.Storage.GetStream(file.File.GetStoragePath());
using var skinStreamReader = new LineBufferedReader(contentStream);
var beatmapSkin = new LegacySkin(new SkinInfo(), null!)
{
Configuration = new LegacySkinDecoder().Decode(new LineBufferedReader(RealmFileStore.Storage.GetStream(file.File.GetStoragePath())))
Configuration = new LegacySkinDecoder().Decode(skinStreamReader)
};
Realm.Realm.Write(realm =>