CHG NotifyIcon is not only removed on user-initiated disposal, but also garbage collection (NTFY-5).

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@174 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2013-11-16 19:55:51 +00:00
parent 2076f8fa0b
commit f534bbc773

View File

@@ -361,9 +361,10 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
private void Dispose(bool disposing)
{
//don't do anything if the component is already disposed
if (IsDisposed || !disposing) return;
if (IsDisposed) return;
IsDisposed = true;
//always destroy the unmanaged handle (even if called from the GC)
WinApi.DestroyWindow(MessageWindowHandle);
messageHandler = null;
}