Hi,
The following patch fixes a crash in mono when invoking
Delegate.Createdelegate(Type,object,string) with a wrong method name
string. Also, I think this is what the docs say that should be done.
The doc that I used is:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdelegateclasscreatedelegatetopic2.asp
Greetings,
Ricardo
--
Ricardo Fern�ndez Pascual
[EMAIL PROTECTED]
Murcia. Espa�a.
Index: class/corlib/System/Delegate.cs
===================================================================
RCS file: /mono/mcs/class/corlib/System/Delegate.cs,v
retrieving revision 1.19
diff -u -r1.19 Delegate.cs
--- class/corlib/System/Delegate.cs 19 Aug 2002 13:27:58 -0000 1.19
+++ class/corlib/System/Delegate.cs 3 Sep 2002 13:47:47 -0000
@@ -98,6 +98,11 @@
BindingFlags flags = BindingFlags.Public |
BindingFlags.Instance;
MethodInfo info = target.GetType ().GetMethod (method, flags);
+
+ if (info == null)
+ throw new ArgumentException
+ (Locale.GetText ("method string is not an
+instance method name"));
+
return CreateDelegate_internal (type, target, info);
}