[Mono-dev] [Mono-patches] r142362 - in trunk/gtk-sharp: . glib

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Mon Sep 21 22:42:01 EDT 2009


Brad,

When explicitly calling Dispose(), Remove() and Source.Remove () are
called. Both will acquire a lock to access the same table and attempt to
remove the same ID...

-Gonzalo

On Mon, 2009-09-21 at 22:19 -0400, Brad Taylor (brad at getcoded.net)
wrote:
> Author: btaylor
> Date: 2009-09-21 22:19:50 -0400 (Mon, 21 Sep 2009)
> New Revision: 142362
> 
> Modified:
>    trunk/gtk-sharp/ChangeLog
>    trunk/gtk-sharp/glib/Idle.cs
>    trunk/gtk-sharp/glib/Timeout.cs
> Log:
> 2009-09-22  Brad Taylor  <brad at getcoded.net>
> 
> 	* glib/Idle.cs: 
> 	* glib/Timeout.cs: Make sure to remove the unmanaged reference to the
> 	delegate when we're disposed or finalized.  In particular, this fixes a
> 	problem where GLib.Object's PerformQueuedUnrefs was being called after
> 	both the object and the handler had been GC'ed, resulting in a
> 	segfault.
[...]
> +			protected virtual void Dispose (bool disposing)
> +			{
> +				if (disposing)
> +					Remove ();
> +				
> +				Source.Remove (ID);
> +			}
> +
[...]



More information about the Mono-devel-list mailing list