vitorsousa pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=17b9f00f7eb70547a8c325a9b057ad36606a6a8b

commit 17b9f00f7eb70547a8c325a9b057ad36606a6a8b
Author: Lauro Moura <lauromo...@expertisesolutions.com.br>
Date:   Tue Feb 6 16:10:36 2018 -0300

    eina_mono: Avoid calling eina_init directly from the modules.
    
    They must be initialized from the eina.Config.Init() method.
---
 src/bindings/mono/eina_mono/eina_error.cs | 6 +-----
 src/bindings/mono/eina_mono/eina_log.cs   | 9 +--------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/bindings/mono/eina_mono/eina_error.cs 
b/src/bindings/mono/eina_mono/eina_error.cs
index c83728047e..58495aa904 100644
--- a/src/bindings/mono/eina_mono/eina_error.cs
+++ b/src/bindings/mono/eina_mono/eina_error.cs
@@ -38,15 +38,11 @@ public struct Error : IComparable<Error>
         return "eina.Error(" + code + ")";
     }
 
-    public static void Init()
+    internal static void Init()
     {
-        if (eina_init() == 0)
-            throw (new efl.EflException("Failed to init Eina"));
-
         EFL_ERROR = eina_error_msg_register("Managed Code Error");
     }
 
-    [DllImport(efl.Libs.Eina)] private static extern int eina_init();
     [DllImport(efl.Libs.Eina)] static extern Error 
eina_error_msg_register(string msg);
     [DllImport(efl.Libs.Eina)] static extern Error eina_error_get();
     [DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error);
diff --git a/src/bindings/mono/eina_mono/eina_log.cs 
b/src/bindings/mono/eina_mono/eina_log.cs
index 747f8ec58c..c5e456c3a6 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -9,8 +9,6 @@ namespace eina { // Manual wrappers around eina functions
 
 public class Log
 {
-    [DllImport(efl.Libs.Eina)] private static extern int eina_init();
-
     [DllImport(efl.Libs.Eina)] private static extern void eina_log_print(
             int domain,
             Level level,
@@ -55,16 +53,11 @@ public class Log
 
     private static int domain = -1;
 
-    public static void Init(String name="mono", String color="\033[32;1m")
+    internal static void Init(String name="mono", String color="\033[32;1m")
     {
         if (domain == -1)
           {
               // Maybe move this check outside when other eina stuff get 
support?
-              if (eina_init() == 0)
-                {
-                   Console.WriteLine("Error: Can't initialize Eina for 
logging.");
-                   return;
-                }
               domain = eina_log_domain_register(name, color);
               if (domain < 0)
                 Console.WriteLine("Error: Couldn't register Eina log domain 
for name {0}.", name);

-- 


Reply via email to