Avoid a crash when global android app is null in separate process
This commit is contained in:
parent
1e3313068f
commit
c2a20e1526
@ -659,6 +659,8 @@ std::string AssetsAndroid::getDataPath()
|
|||||||
{
|
{
|
||||||
Log::warn("AssetsAndroid", "Cannot use standard data dir");
|
Log::warn("AssetsAndroid", "Cannot use standard data dir");
|
||||||
|
|
||||||
|
if (global_android_app)
|
||||||
|
{
|
||||||
AndroidApplicationInfo application_info =
|
AndroidApplicationInfo application_info =
|
||||||
CIrrDeviceAndroid::getApplicationInfo(global_android_app->activity);
|
CIrrDeviceAndroid::getApplicationInfo(global_android_app->activity);
|
||||||
|
|
||||||
@ -669,6 +671,7 @@ std::string AssetsAndroid::getDataPath()
|
|||||||
{
|
{
|
||||||
data_path = "";
|
data_path = "";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return data_path;
|
return data_path;
|
||||||
#endif
|
#endif
|
||||||
@ -683,10 +686,15 @@ std::string AssetsAndroid::getDataPath()
|
|||||||
std::string AssetsAndroid::getLibPath()
|
std::string AssetsAndroid::getLibPath()
|
||||||
{
|
{
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
|
std::string lib_path;
|
||||||
|
|
||||||
|
if (global_android_app)
|
||||||
|
{
|
||||||
AndroidApplicationInfo application_info =
|
AndroidApplicationInfo application_info =
|
||||||
CIrrDeviceAndroid::getApplicationInfo(global_android_app->activity);
|
CIrrDeviceAndroid::getApplicationInfo(global_android_app->activity);
|
||||||
|
|
||||||
std::string lib_path = application_info.native_lib_dir;
|
lib_path = application_info.native_lib_dir;
|
||||||
|
}
|
||||||
|
|
||||||
if (access(lib_path.c_str(), R_OK) != 0)
|
if (access(lib_path.c_str(), R_OK) != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user