Dispose of log's streamwriter properly.

Fixes issues if TShock is reloaded.
This commit is contained in:
Deathmax 2011-12-19 22:29:59 +08:00
parent 1ce950fa32
commit b0becb50d1
2 changed files with 9 additions and 0 deletions

View file

@ -131,6 +131,14 @@ namespace TShockAPI
Write(message, LogLevel.Debug);
}
/// <summary>
/// Disposes objects that are being used.
/// </summary>
public static void Dispose()
{
_logWriter.Dispose();
}
/// <summary>
/// Internal method which writes a message directly to the log file.
/// </summary>

View file

@ -309,6 +309,7 @@ namespace TShockAPI
File.Delete(Path.Combine(SavePath, "tshock.pid"));
}
RestApi.Dispose();
Log.Dispose();
}
base.Dispose(disposing);