protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (this.disposed)
return;
if (disposing)
{
this.components?.Dispose();
//後始末
SearchDialog.Dispose();
UrlDialog.Dispose();
NIconAt?.Dispose();
NIconAtRed?.Dispose();
NIconAtSmoke?.Dispose();
foreach (var iconRefresh in this.NIconRefresh)
{
iconRefresh?.Dispose();
}
TabIcon?.Dispose();
MainIcon?.Dispose();
ReplyIcon?.Dispose();
ReplyIconBlink?.Dispose();
_listViewImageList.Dispose();
_brsHighLight.Dispose();
_brsBackColorMine?.Dispose();
_brsBackColorAt?.Dispose();
_brsBackColorYou?.Dispose();
_brsBackColorAtYou?.Dispose();
_brsBackColorAtFromTarget?.Dispose();
_brsBackColorAtTo?.Dispose();
_brsBackColorNone?.Dispose();
_brsDeactiveSelection?.Dispose();
//sf.Dispose();
sfTab.Dispose();
this.workerCts.Cancel();
if (IconCache != null)
{
this.IconCache.CancelAsync();
this.IconCache.Dispose();
}
this.thumbnailTokenSource?.Dispose();
this.tw.Dispose();
this.twitterApi.Dispose();
this._hookGlobalHotkey.Dispose();
}
// 終了時にRemoveHandlerしておかないとメモリリークする
// http://msdn.microsoft.com/ja-jp/library/microsoft.win32.systemevents.powermodechanged.aspx
Microsoft.Win32.SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
this.disposed = true;
}