diff --git a/jnius/jnius.pyx b/jnius/jnius.pyx index df4644f1..c784ff26 100644 --- a/jnius/jnius.pyx +++ b/jnius/jnius.pyx @@ -88,7 +88,7 @@ Python:: __all__ = ('JavaObject', 'JavaClass', 'JavaMethod', 'JavaField', 'JavaStaticMethod', 'JavaStaticField', 'JavaMultipleMethod', 'MetaJavaBase', 'MetaJavaClass', 'JavaException', 'cast', - 'find_javaclass', 'PythonJavaClass', 'java_method', 'detach') + 'find_javaclass', 'PythonJavaClass', 'java_method', 'detach', 'get_jni_java_vm') from libc.stdlib cimport malloc, free from functools import partial diff --git a/jnius/jnius_env.pxi b/jnius/jnius_env.pxi index 336ab0ec..1ae686e8 100644 --- a/jnius/jnius_env.pxi +++ b/jnius/jnius_env.pxi @@ -1,3 +1,5 @@ +from libc.stdint cimport intptr_t + cdef JNIEnv *default_env = NULL @@ -23,3 +25,5 @@ cdef JNIEnv *get_jnienv() except NULL: def detach(): jvm[0].DetachCurrentThread(jvm) +def get_jni_java_vm(): + return default_env, jvm