From 0eece4438f38b0732cfc15704ad72c6dcedf7bcb Mon Sep 17 00:00:00 2001 From: Brad Taylor Date: Tue, 22 Sep 2009 02:52:41 +0000 Subject: [PATCH] 2009-09-22 Brad Taylor * glib/Idle.cs: * glib/Timeout.cs: Don't try to remove the handler from the managed hashtable twice, add a comment explaining the need for the else branch. svn path=/trunk/gtk-sharp/; revision=142364 --- ChangeLog | 6 ++++++ glib/Idle.cs | 8 ++++++-- glib/Timeout.cs | 9 +++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbda13884..c0ad5715a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-22 Brad Taylor + + * glib/Idle.cs: + * glib/Timeout.cs: Don't try to remove the handler from the managed + hashtable twice, add a comment explaining the need for the else branch. + 2009-09-22 Brad Taylor * glib/Idle.cs: diff --git a/glib/Idle.cs b/glib/Idle.cs index 953cd7c7f..9bfc01ac7 100755 --- a/glib/Idle.cs +++ b/glib/Idle.cs @@ -58,10 +58,14 @@ namespace GLib { protected virtual void Dispose (bool disposing) { + // Both branches remove our delegate from the + // managed list of handlers, but only + // Source.Remove will remove it from the + if (disposing) Remove (); - - Source.Remove (ID); + else + Source.Remove (ID); } public bool Handler () diff --git a/glib/Timeout.cs b/glib/Timeout.cs index faedf50b9..9aa348af5 100755 --- a/glib/Timeout.cs +++ b/glib/Timeout.cs @@ -55,10 +55,15 @@ namespace GLib { protected virtual void Dispose (bool disposing) { + // Both branches remove our delegate from the + // managed list of handlers, but only + // Source.Remove will remove it from the + // unmanaged list also. + if (disposing) Remove (); - - Source.Remove (ID); + else + Source.Remove (ID); } public bool Handler ()