mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Use static initialization for Android class loader
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user