324a933b6523f6a0637c8bf185b72c5a1745374b
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / NativeModule.cs
1 using System;
2
3 namespace Efl { namespace Eo {
4
5 public partial class NativeModule : IDisposable
6 {
7     private Lazy<IntPtr> module;
8
9     public NativeModule(string libName)
10     {
11         module = new Lazy<IntPtr>
12             (() =>
13              {
14                  return LoadLibrary(libName);
15              });
16     }
17
18     public IntPtr Module
19     {
20         get
21         {
22             return module.Value;
23         }
24     }
25
26     public void Dispose()
27     {
28         UnloadLibrary(module.Value);
29         module = null;
30     }
31 }
32
33 } }