mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use static initialization for Android class loader
This commit is contained in:
parent
60a2d5c1f6
commit
484523f82f
|
@ -27,7 +27,7 @@ AndroidClassLoader::~AndroidClassLoader()
|
|||
jobject AndroidClassLoader::_classLoader;
|
||||
jmethodID AndroidClassLoader::_findClassMethod;
|
||||
|
||||
static std::shared_ptr<AndroidClassLoader> acl;
|
||||
static std::shared_ptr<AndroidClassLoader> acl = std::make_shared<AndroidClassLoader>();
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
|
@ -173,11 +173,6 @@ namespace Platform
|
|||
return displayScale;
|
||||
}
|
||||
|
||||
void AndroidInitClassLoader()
|
||||
{
|
||||
acl = std::make_shared<AndroidClassLoader>();
|
||||
}
|
||||
|
||||
jclass AndroidFindClass(JNIEnv* env, std::string_view name)
|
||||
{
|
||||
return static_cast<jclass>(env->CallObjectMethod(
|
||||
|
|
|
@ -39,15 +39,6 @@ namespace Platform
|
|||
{
|
||||
void CoreInit()
|
||||
{
|
||||
static bool initialised = false;
|
||||
if (!initialised)
|
||||
{
|
||||
initialised = true;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
Platform::AndroidInitClassLoader();
|
||||
#endif // __ANDROID__
|
||||
}
|
||||
}
|
||||
|
||||
CurrencyType GetCurrencyValue(const char* currCode)
|
||||
|
|
|
@ -103,7 +103,6 @@ namespace Platform
|
|||
bool SetupUriProtocol();
|
||||
#endif
|
||||
#ifdef __ANDROID__
|
||||
void AndroidInitClassLoader();
|
||||
jclass AndroidFindClass(JNIEnv* env, std::string_view name);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue