Properly unsubscribe from TerrainAtlasChanged events.

This commit is contained in:
UnknownShadow200 2015-06-30 13:10:16 +10:00
parent 9a52cd317f
commit 658f2518fe
2 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,10 @@ namespace ClassicalSharp {
arraysCount = newArraysCount;
}
public void Dispose() {
Window.TerrainAtlasChanged -= TerrainAtlasChanged;
}
class DrawInfo1D {
public DrawInfo1DPart Solid = new DrawInfo1DPart();
public DrawInfo1DPart Translucent = new DrawInfo1DPart();

View file

@ -52,9 +52,11 @@ namespace ClassicalSharp {
ClearChunkCache();
chunks = null;
unsortedChunks = null;
Window.TerrainAtlasChanged -= TerrainAtlasChanged;
Window.OnNewMap -= OnNewMap;
Window.OnNewMapLoaded -= OnNewMapLoaded;
Window.EnvVariableChanged -= EnvVariableChanged;
builder.Dispose();
}
public void Refresh() {