Skip to content

Commit

Permalink
fix javaVM return value
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed May 2, 2024
1 parent 71875f9 commit 3ebd4ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jmi.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* JMI: JNI Modern Interface
* Copyright (C) 2016-2023 Wang Bin - wbsecg1@gmail.com
* Copyright (C) 2016-2024 Wang Bin - wbsecg1@gmail.com
* https://github.com/wang-bin/JMI
* MIT License
*/
Expand Down Expand Up @@ -45,10 +45,11 @@ static jint jni_ver = JNI_VERSION_1_4;

JavaVM* javaVM(JavaVM *vm, jint v) {
static JavaVM *jvm_ = nullptr;
const auto old = jvm_;
if (vm)
jvm_ = vm;
jni_ver = v;
return jvm_;
return old;
}

static void detach(void* = nullptr)
Expand Down

0 comments on commit 3ebd4ef

Please sign in to comment.