Skip to content

Commit 8f584f3

Browse files
authored
Add get_jni_java_vm function (#710)
1 parent 5339089 commit 8f584f3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

jnius/jnius.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Python::
8888
__all__ = ('JavaObject', 'JavaClass', 'JavaMethod', 'JavaField',
8989
'JavaStaticMethod', 'JavaStaticField', 'JavaMultipleMethod',
9090
'MetaJavaBase', 'MetaJavaClass', 'JavaException', 'cast',
91-
'find_javaclass', 'PythonJavaClass', 'java_method', 'detach')
91+
'find_javaclass', 'PythonJavaClass', 'java_method', 'detach', 'get_jni_java_vm')
9292

9393
from libc.stdlib cimport malloc, free
9494
from functools import partial

jnius/jnius_env.pxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from libc.stdint cimport intptr_t
2+
13

24
cdef JNIEnv *default_env = NULL
35

@@ -23,3 +25,5 @@ cdef JNIEnv *get_jnienv() except NULL:
2325
def detach():
2426
jvm[0].DetachCurrentThread(jvm)
2527

28+
def get_jni_java_vm():
29+
return <intptr_t>default_env, <intptr_t>jvm

0 commit comments

Comments
 (0)