[Mono-dev] [PATCH] MWF: Don't dispose objects that are not owned

Kornél Pál kornelpal at hotmail.com
Sun Oct 23 07:00:25 EDT 2005


Hi,

Objects should not dispose objects that were not created by them as they may
be needed by other objects.

This patch fixes the above described problem.

In addition NotifyIcon assumes that Graphics.DrawIcon uses Icon.ToBitmap and
Graphics.DrawImage that should not be assumed as DrawIcon should be modified
to have better performance so I modified the code to use Graphics.DrawIcon.

And added HideSystray to NotifyIcon.Dispose as at least on Windows it is
required. Otherwise notify icon is displayed until you move mouse over even
when it's host process already terminated. Note that I expecienced that
notify icon is not removed on Windows but it seems to be a bug in
XplatUI.SystrayRemove rather than in NotifyIcon.

Please review and approve the patch.

Kornél
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FixMWFDispose.diff
Type: application/octet-stream
Size: 3706 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051023/bb899e42/attachment.obj 


More information about the Mono-devel-list mailing list