Dispose of log's streamwriter properly.
Fixes issues if TShock is reloaded.
This commit is contained in:
parent
1ce950fa32
commit
b0becb50d1
2 changed files with 9 additions and 0 deletions
|
|
@ -131,6 +131,14 @@ namespace TShockAPI
|
||||||
Write(message, LogLevel.Debug);
|
Write(message, LogLevel.Debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disposes objects that are being used.
|
||||||
|
/// </summary>
|
||||||
|
public static void Dispose()
|
||||||
|
{
|
||||||
|
_logWriter.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Internal method which writes a message directly to the log file.
|
/// Internal method which writes a message directly to the log file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,7 @@ namespace TShockAPI
|
||||||
File.Delete(Path.Combine(SavePath, "tshock.pid"));
|
File.Delete(Path.Combine(SavePath, "tshock.pid"));
|
||||||
}
|
}
|
||||||
RestApi.Dispose();
|
RestApi.Dispose();
|
||||||
|
Log.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue