From d6be561887d4362277d679adda122870639dc959 Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Date: Wed, 28 May 2008 16:34:50 +0000 Subject: [PATCH] 2008-05-28 Lluis Sanchez Gual * gtk/Object.custom: If all destroy handlers have been unregistered, remove the hashtable entry since it is not needed anymore. svn path=/trunk/gtk-sharp/; revision=104287 --- ChangeLog | 6 ++++++ gtk/Object.custom | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f7628af4a..444121756 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-28 Lluis Sanchez Gual + + * gtk/Object.custom: If all destroy handlers have been + unregistered, remove the hashtable entry since it is + not needed anymore. + 2008-05-27 Mike Kestner * generator/Method.cs (GenerateBody): when generating value type diff --git a/gtk/Object.custom b/gtk/Object.custom index ba1289a19..d52eab9e5 100755 --- a/gtk/Object.custom +++ b/gtk/Object.custom @@ -57,7 +57,11 @@ } remove { EventHandler handler = (EventHandler) DestroyHandlers [Handle]; - DestroyHandlers [Handle] = Delegate.Remove (handler, value); + handler = (EventHandler) Delegate.Remove (handler, value); + if (handler != null) + DestroyHandlers [Handle] = handler; + else + DestroyHandlers.Remove (Handle); } }