IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
LibJava.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.IO;
3
4
namespace
IKVM.Runtime
5
{
6
7
#if FIRST_PASS == false && IMPORTER == false && EXPORTER == false
8
16
internal
unsafe
class
LibJava
17
{
18
22
public
static
readonly LibJava Instance =
new
();
23
27
LibJava()
28
{
29
// load libiava through libjvm as it is a JNI library
30
if
((Handle = LibJvm.Instance.JVM_LoadLibrary(Path.Combine(JVM.Properties.HomePath,
"bin"
, NativeLibrary.MapLibraryName(
"iava"
)))) == 0)
31
throw
new
InternalException(
"Could not load libiava."
);
32
}
33
37
public
nint Handle {
get
;
private
set
; }
38
42
~LibJava()
43
{
44
if
(Environment.HasShutdownStarted ==
false
)
45
{
46
if
(Handle != 0)
47
{
48
var h = Handle;
49
Handle = 0;
50
LibJvm.Instance.JVM_UnloadLibrary(h);
51
}
52
}
53
}
54
55
}
56
57
#endif
58
59
}
IKVM.Runtime
Definition
Accessor.cs:5
System
Definition
HexConverter.cs:9
src
IKVM.Runtime
LibJava.cs
Generated by
1.12.0