Value: First try to invoke a constructor with IntPtr, bool
In Cairo there the default constructor does not take a ref to the native object making the object invalid when trying to access it. This commit changes the behaviour to search for another constructor that takes an owner variable which is set to false when invoked to indicate that the managed side should take a ref.
This commit is contained in:
parent
7ea0c4afaf
commit
1fab57eeac
1 changed files with 5 additions and 1 deletions
|
@ -437,7 +437,11 @@ namespace GLib {
|
|||
if (mi != null)
|
||||
return mi.Invoke (null, new object[] {boxed_ptr});
|
||||
|
||||
ConstructorInfo ci = t.GetConstructor (new Type[] { typeof(IntPtr) });
|
||||
ConstructorInfo ci = t.GetConstructor (new Type[] { typeof(IntPtr), typeof (bool) });
|
||||
if (ci != null)
|
||||
return ci.Invoke (new object[] { boxed_ptr, false });
|
||||
|
||||
ci = t.GetConstructor (new Type[] { typeof(IntPtr) });
|
||||
if (ci != null)
|
||||
return ci.Invoke (new object[] { boxed_ptr });
|
||||
|
||||
|
|
Loading…
Reference in a new issue