diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs index 1b57da029c..833b7d5da8 100644 --- a/src/bindings/mono/eina_mono/eina_config.cs +++ b/src/bindings/mono/eina_mono/eina_config.cs @@ -2,20 +2,24 @@ using System; using System.Runtime.InteropServices; +using System.ComponentModel; namespace Eina { /// /// Manage the initialization and cleanup for eina. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class Config { [DllImport(efl.Libs.Eina)] private static extern int eina_init(); [DllImport(efl.Libs.Eina)] private static extern int eina_shutdown(); + /// + /// Initialize the Eina library. + /// Since EFL 1.23. + /// public static void Init() { if (eina_init() == 0) @@ -24,6 +28,10 @@ public class Config } } + /// + /// Finalize the Eina library. + /// Since EFL 1.23. + /// public static int Shutdown() { return eina_shutdown(); @@ -33,29 +41,41 @@ public class Config /// /// Wrapper class for pointers that need some cleanup afterwards like strings -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class DisposableIntPtr : IDisposable { + [EditorBrowsable(EditorBrowsableState.Never)] public IntPtr Handle { get; set; } private bool ShouldFree; private bool Disposed; /// Wraps a new ptr what will be freed based on the - /// value of shouldFree + /// value of shouldFree + /// Since EFL 1.23. + /// public DisposableIntPtr(IntPtr ptr, bool shouldFree = false) { Handle = ptr; ShouldFree = shouldFree; } + + /// Release the native resources held by this instance. + /// Since EFL 1.23. + /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } + /// Disposes of this wrapper, releasing the native handle if + /// owned. + /// Since EFL 1.23. + /// + /// True if this was called from public method. False if + /// called from the C# finalizer. protected virtual void Dispose(bool disposing) { if (!Disposed && ShouldFree) @@ -66,6 +86,10 @@ public class DisposableIntPtr : IDisposable Disposed = true; } + + /// Release the native resources held by this instance. + /// Since EFL 1.23. + /// ~DisposableIntPtr() { Dispose(false);