public static void Uninitialize()
{
try
{
if (_thread != null)
{
_stopThread = true;
for (int i = 0; i < 10; i++)
{
if (_thread.ThreadState == System.Threading.ThreadState.Stopped)
break;
System.Threading.Thread.Sleep(50);
Application.DoEvents();
}
if (_thread.ThreadState != System.Threading.ThreadState.Stopped)
_thread.Abort();
_thread = null;
}
}
catch (Exception ex)
{
BNS_ACT_Plugin.LogParserMessage("Error [BNS_Log.Uninitialize] " + ex.ToString().Replace(Environment.NewLine, " "));
}
}
public void DeInitPlugin() { // remove event handler Advanced_Combat_Tracker.ActGlobals.oFormActMain.UpdateCheckClicked -= this.UpdateCheckClicked; Advanced_Combat_Tracker.ActGlobals.oFormActMain.BeforeLogLineRead -= LogParse.BeforeLogLineRead; LogWriter.Uninitialize(); if (lblStatus != null) { lblStatus.Text = "BnS Plugin Unloaded."; lblStatus = null; } }