summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono/iwrapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/mono/eo_mono/iwrapper.cs')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index caf28a7..7c2eeb4 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -624,14 +624,15 @@ public class Globals
624 try 624 try
625 { 625 {
626 var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; 626 var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
627 constructor = managedType.GetConstructor(flags, null, new Type[1] { typeof(System.IntPtr) }, null); 627 constructor = managedType.GetConstructor(flags, null, new Type[1] { typeof(WrappingHandle) }, null);
628 } 628 }
629 catch (InvalidOperationException) 629 catch (InvalidOperationException)
630 { 630 {
631 throw new InvalidOperationException($"Can't get constructor for type {managedType}"); 631 throw new InvalidOperationException($"Can't get constructor for type {managedType}");
632 } 632 }
633 633
634 var ret = (Efl.Eo.IWrapper) constructor.Invoke(new object[1] { handle }); 634 WrappingHandle wh = new WrappingHandle(handle);
635 var ret = (Efl.Eo.IWrapper) constructor.Invoke(new object[1] { wh });
635 636
636 if (ret == null) 637 if (ret == null)
637 { 638 {
@@ -715,6 +716,21 @@ public class Globals
715 Monitor.Exit(Efl.All.InitLock); 716 Monitor.Exit(Efl.All.InitLock);
716 } 717 }
717 718
719 /// <sumary>
720 /// Internal struct used by the binding to pass the native handle pointer
721 /// to the managed object wrapping constructor.
722 /// Internal usage only: do not use this class in inherited classes.
723 /// </sumary>
724 public struct WrappingHandle
725 {
726 public WrappingHandle(IntPtr h)
727 {
728 NativeHandle = h;
729 }
730
731 public IntPtr NativeHandle { get; private set; }
732 }
733
718} // Globals 734} // Globals
719 735
720public static class Config 736public static class Config