systray patch?

Ove Kaaven ovek at
Fri Feb 27 04:45:15 CST 2004

I'm trying to let someone use Wine instead of rdesktop-ing to Windows
(there are incentives such as that Windows has made itself unbootable
*again*), but Wine seems a little bit unstable, too. My guess is a
memory leak. I looked at a backtrace on the off chance that it crashed
where the leak was, and came up with this potential icon leak. I haven't
tested whether this patch actually fixes the problem yet, but does it
seem OK anyway?

Index: dlls/shell32/systray.c
RCS file: /home/wine/wine/dlls/shell32/systray.c,v
retrieving revision 1.25
diff -u -r1.25 systray.c
--- dlls/shell32/systray.c	2 Jan 2004 20:12:51 -0000	1.25
+++ dlls/shell32/systray.c	27 Feb 2004 10:36:20 -0000
@@ -246,6 +246,8 @@
 void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon)
+  if(ptrayItem->notifyIcon.hIcon)
+    DestroyIcon(ptrayItem->notifyIcon.hIcon);
   ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon);
   InvalidateRect(ptrayItem->hWnd, NULL, TRUE);

More information about the wine-patches mailing list