Dispose MapPreviews and map packages.
This commit is contained in:
@@ -269,6 +269,9 @@ namespace OpenRA
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var p in previews.Values)
|
||||||
|
p.Dispose();
|
||||||
|
|
||||||
// We need to let the loader thread exit before we can dispose our sheet builder.
|
// We need to let the loader thread exit before we can dispose our sheet builder.
|
||||||
// Ideally we should dispose our resources before returning, but we don't to block waiting on the loader thread to exit.
|
// Ideally we should dispose our resources before returning, but we don't to block waiting on the loader thread to exit.
|
||||||
// Instead, we'll queue disposal to be run once it has exited.
|
// Instead, we'll queue disposal to be run once it has exited.
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace OpenRA
|
|||||||
public readonly bool downloading;
|
public readonly bool downloading;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MapPreview
|
public class MapPreview : IDisposable
|
||||||
{
|
{
|
||||||
static readonly CPos[] NoSpawns = new CPos[] { };
|
static readonly CPos[] NoSpawns = new CPos[] { };
|
||||||
MapCache cache;
|
MapCache cache;
|
||||||
@@ -344,5 +344,14 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
Status = MapStatus.Unavailable;
|
Status = MapStatus.Unavailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (Package != null)
|
||||||
|
{
|
||||||
|
Package.Dispose();
|
||||||
|
Package = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user