Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=81627 --- shadow/81627 2007-07-20 05:11:59.000000000 -0400 +++ shadow/81627.tmp.1027 2007-07-20 09:28:05.000000000 -0400 @@ -256,6 +256,49 @@ Besides that, it looks great :) ------- Additional Comments From [EMAIL PROTECTED] 2007-07-20 05:11 ------- Created an attachment (id=19586) MulticastDelegate.cs - MS.net approach, incorporating Rodrigo's feedback + +------- Additional Comments From [EMAIL PROTECTED] 2007-07-20 09:28 ------- +Attaching a patch containing all the code implementing chained +MulticastDelegates the MS.net-way. It doesn't work yet. + +I'm using following trivial test program: + +using System; +class Test { + delegate void SomeHandler(); + static void Handler1() { Console.WriteLine("Handler1"); } + static void Handler2() { Console.WriteLine("Handler2");} + static void Main() { + SomeHandler del_1 = new SomeHandler(Handler1); + del_1(); + SomeHandler del_12 = (SomeHandler)Delegate.Combine(del_1, new +SomeHandler(Handler2)); + del_12(); + } +} + + +The resulting output should be: +------------------------------- +Handler1 +Handler1 +Handler2 + +But it throws an NRE: +--------------------- +Handler1 + +Unhandled Exception: System.NullReferenceException: Object reference +not set to an instance of an object + at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void () + at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void () + at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void () + at Test.Main () [0x00000] + + +Could somebody take a look at my code (especially +"mono_marshal_get_delegate_invoke" in marshal.c). It's my first +venture into the mono runtime... _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
