1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

apply review comments for CAndroidVMHelper

This commit is contained in:
Andrii Danylchenko 2018-05-26 14:50:49 +03:00
parent ee033e9c9c
commit dcbcff41dc
4 changed files with 4 additions and 11 deletions

View File

@ -155,9 +155,10 @@ void CServerHandler::startLocalServerAndConnect()
th->update();
#ifdef VCMI_ANDROID
CAndroidVMHelper envHelper;
envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true);
envHelper.Detach();
{
CAndroidVMHelper envHelper;
envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true);
}
#else
threadRunLocalServer = std::make_shared<boost::thread>(&CServerHandler::threadRunServer, this); //runs server executable;
#endif

View File

@ -43,11 +43,6 @@ CAndroidVMHelper::CAndroidVMHelper()
}
}
CAndroidVMHelper::~CAndroidVMHelper()
{
Detach();
}
void CAndroidVMHelper::Detach()
{
if(envPtr && detachInDestructor)
{

View File

@ -29,8 +29,6 @@ public:
~CAndroidVMHelper();
void Detach();
JNIEnv * get();
jclass findClassloadedClass(const std::string & name);

View File

@ -179,7 +179,6 @@ void CVCMIServer::run()
#else
CAndroidVMHelper vmHelper;
vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "onServerReady");
vmHelper.Detach();
#endif
}