[Gtk-sharp-list] patch for generator/SignalHandler.cs

Petr Danecek danecek@ucl.cas.cz
28 Feb 2003 11:13:39 +0100


--=-l8JIJ0yBGBDFqALXIwiv
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,
in Dispose method of signal callbacks generated by SignalHandler there
is an incorrect condition statement:

protected override void Dispose (bool disposing)
{
	_Instances.Remove(_key);
	if(_Instances.Count == 0) {
		g_signal_handler_disconnect (_raw, _HandlerID);
                 _Delegate = null;
        }
}

I think that g_signal_handler_disconnect should be called 
always, not only when the value of the static property _Instances.Count
is 0. I am also not sure, what is the meaning of the _Delegate = null
assignment.

best regards,
pd



--=-l8JIJ0yBGBDFqALXIwiv
Content-Disposition: attachment; filename=file.diff
Content-Type: text/x-patch; name=file.diff; charset=ISO-8859-2
Content-Transfer-Encoding: 7bit

Index: generator/SignalHandler.cs
===================================================================
RCS file: /mono/gtk-sharp/generator/SignalHandler.cs,v
retrieving revision 1.21
diff -u -p -u -r1.21 SignalHandler.cs
--- generator/SignalHandler.cs	26 Feb 2003 02:16:38 -0000	1.21
+++ generator/SignalHandler.cs	28 Feb 2003 09:28:38 -0000
@@ -187,10 +187,10 @@ namespace GtkSharp.Generation {
 			sw.WriteLine("\t\tprotected override void Dispose (bool disposing)");
 			sw.WriteLine("\t\t{");
 			sw.WriteLine("\t\t\t_Instances.Remove(_key);");
-			sw.WriteLine("\t\t\tif(_Instances.Count == 0) {");
+//			sw.WriteLine("\t\t\tif(_Instances.Count == 0) {");
 			sw.WriteLine("\t\t\t\tg_signal_handler_disconnect (_raw, _HandlerID);");
 			sw.WriteLine("\t\t\t\t_Delegate = null;");
-			sw.WriteLine("\t\t\t}");
+//			sw.WriteLine("\t\t\t}");
 			sw.WriteLine("\t\t}");
 			sw.WriteLine("\t}");
 			sw.WriteLine("}");

--=-l8JIJ0yBGBDFqALXIwiv--