summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono/NativeModule.cs
blob: 324a933b6523f6a0637c8bf185b72c5a1745374b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;

namespace Efl { namespace Eo {

public partial class NativeModule : IDisposable
{
    private Lazy<IntPtr> module;

    public NativeModule(string libName)
    {
        module = new Lazy<IntPtr>
            (() =>
             {
                 return LoadLibrary(libName);
             });
    }

    public IntPtr Module
    {
        get
        {
            return module.Value;
        }
    }

    public void Dispose()
    {
        UnloadLibrary(module.Value);
        module = null;
    }
}

} }