1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

fix using JNI from server in single process build

This commit is contained in:
Andrey Filipenkov
2023-02-26 12:19:24 +03:00
parent c4e7e91850
commit 313d479d42
6 changed files with 38 additions and 7 deletions

View File

@ -18,6 +18,8 @@ static JavaVM * vmCache = nullptr;
static jobject vcmiClassLoader;
static jmethodID vcmiFindClassMethod;
bool CAndroidVMHelper::alwaysUseLoadedClass = false;
void CAndroidVMHelper::cacheVM(JNIEnv * env)
{
env->GetJavaVM(&vmCache);
@ -91,7 +93,7 @@ void CAndroidVMHelper::callCustomMethod(const std::string & cls, const std::stri
jclass CAndroidVMHelper::findClass(const std::string & name, bool classloaded)
{
if(classloaded)
if(alwaysUseLoadedClass || classloaded)
{
return findClassloadedClass(name);
}