aboutsummaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-10 15:04:22 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-04-10 15:12:47 -0300
commitfeaf0e92995d7cb27055e1588df21a8f4376424a (patch)
tree2216d6cd8d4b7924cc20955d9a203982b1701954 /src/bindings
parentecore drm2 - handle possible NULL fb when doing a flip (diff)
downloadefl-feaf0e92995d7cb27055e1588df21a8f4376424a.tar.gz
csharp: Fix GetUserMethods and NativeClass
Summary: - Should only search for methods locally. - dotnet requires passing false to GetAttributes - Also added a check when the class overrides no Eo ops. Reviewers: felipealmeida, vitor.sousa, woohyun Reviewed By: felipealmeida, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8588
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 5850da8c5c..4f4181d244 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -290,7 +290,7 @@ public class Globals
private static Efl.Eo.NativeClass GetNativeClass(System.Type type)
{
- var attrs = System.Attribute.GetCustomAttributes(type);
+ var attrs = System.Attribute.GetCustomAttributes(type, false);
foreach (var attr in attrs)
{
if (attr is Efl.Eo.NativeClass)
@@ -306,21 +306,21 @@ public class Globals
GetUserMethods(System.Type type)
{
var r = new System.Collections.Generic.List<System.Reflection.MethodInfo>();
- r.AddRange(type.GetMethods());
+ var flags = System.Reflection.BindingFlags.Instance
+ | System.Reflection.BindingFlags.DeclaredOnly
+ | System.Reflection.BindingFlags.Public
+ | System.Reflection.BindingFlags.NonPublic;
+ r.AddRange(type.GetMethods(flags));
var base_type = type.BaseType;
for (;base_type != null; base_type = base_type.BaseType)
{
- var attrs = System.Attribute.GetCustomAttributes(type);
- foreach (var attr in attrs)
+ if (IsGeneratedClass(base_type))
{
- if (attr is Efl.Eo.NativeClass)
- {
- return r;
- }
+ return r;
}
- r.AddRange(base_type.GetMethods());
+ r.AddRange(base_type.GetMethods(flags));
}
return r;
}
@@ -353,7 +353,13 @@ public class Globals
}
}
- IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0]) * count);
+ IntPtr descs_ptr = IntPtr.Zero;
+
+ if (count > 0)
+ {
+ descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0]) * count);
+ }
+
IntPtr ptr = descs_ptr;
for (int i = 0; i != count; ++i)
{