Fix elm_config_profile_get interop function
authorpius.lee <pius.lee@samsung.com>
Mon, 17 Jul 2017 01:20:32 +0000 (10:20 +0900)
committerpius.lee <pius.lee@samsung.com>
Mon, 17 Jul 2017 01:20:32 +0000 (10:20 +0900)
Remove string auto mashaling from interop function.

Change-Id: Ia54408e9b033c2d408a26b7e571181232d1a8218

src/ElmSharp/Interop/Interop.Elementary.cs

index f63a9c3..3791d11 100644 (file)
@@ -71,8 +71,14 @@ internal static partial class Interop
         [DllImport(Libraries.Elementary)]
         internal static extern double elm_config_scale_get();
 
-        [DllImport(Libraries.Elementary)]
-        internal static extern string elm_config_profile_get();
+        [DllImport(Libraries.Elementary, EntryPoint = "elm_config_profile_get")]
+        internal static extern IntPtr _elm_config_profile_get();
+
+        internal static string elm_config_profile_get()
+        {
+            var str = _elm_config_profile_get();
+            return Marshal.PtrToStringAnsi(str);
+        }
 
         [DllImport(Libraries.Elementary)]
         internal static extern void elm_config_preferred_engine_set(string name);