[Mono-dev] [PATCH] MWF: Don't dispose objects that are not owned
Kornél Pál
kornelpal at hotmail.com
Sun Oct 23 10:55:55 EDT 2005
Hi,
OK. I have plans on some modifications to Icon class as it lacks of
important functionalities. You are right that using ToBitmap() is much
faster currently so it's OK to retain the current solution until
Graphics.DrawIcon will work as it should.
It it OK to add HideSystray(); to NotifyIcon.Dispose?
Kornél
----- Original Message -----
From: "Peter Dennis Bartok" <peter at novonyx.com>
To: "Kornél Pál" <kornelpal at hotmail.com>; <mono-devel-list at lists.ximian.com>
Sent: Sunday, October 23, 2005 4:43 PM
Subject: Re: [Mono-dev] [PATCH] MWF: Don't dispose objects that are not
owned
> Kornel,
>
> The changes to not call Dispose are ok. The NotifyIcon patch is not ok to
> check in, I want it to use ToBitmap() once instead of every refresh. It
> doesn't matter if ideologically it should use DrawIcon, fact is that we'd
> be
> creating and throwing away bitmaps at considerable cost on every refresh
> if
> we use it, so it needs to stay the way it is today.
>
> Peter
>
> -----Original Message-----
> From: "Kornél Pál" <kornelpal at hotmail.com>
> To: <mono-devel-list at lists.ximian.com>
> Date: 23 October, 2005 05:01
> Subject: [Mono-dev] [PATCH] MWF: Don't dispose objects that are not owned
>
>
>>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
>>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list