Fix Android crash caused by incorrect type in progress dialog callbacks (#58)
Bug discovered via an incomplete fix in Sudachi. Some Progress Dialog callbacks pass the wrong type (Double instead of Long) from C++ to Java code causing a crash at runtime. To fix this a new function is implemented to convert to a Java Long and that is used instead of the function that converts to a Double. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/58 Co-authored-by: echosys <echosys@noreply.localhost> Co-committed-by: echosys <echosys@noreply.localhost>
This commit is contained in:
parent
ec2e6dfdac
commit
ab4c093976
5 changed files with 43 additions and 6 deletions
|
|
@ -459,8 +459,8 @@ int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject
|
|||
jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) {
|
||||
auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod,
|
||||
Common::Android::ToJDouble(env, max),
|
||||
Common::Android::ToJDouble(env, progress));
|
||||
Common::Android::ToJLong(env, max),
|
||||
Common::Android::ToJLong(env, progress));
|
||||
return Common::Android::GetJBoolean(env, jwasCancelled);
|
||||
};
|
||||
|
||||
|
|
@ -791,8 +791,8 @@ jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyInstalledContents(JNIEn
|
|||
jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) {
|
||||
auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod,
|
||||
Common::Android::ToJDouble(env, max),
|
||||
Common::Android::ToJDouble(env, progress));
|
||||
Common::Android::ToJLong(env, max),
|
||||
Common::Android::ToJLong(env, progress));
|
||||
return Common::Android::GetJBoolean(env, jwasCancelled);
|
||||
};
|
||||
|
||||
|
|
@ -814,8 +814,8 @@ jint Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyGameContents(JNIEnv* env, jobje
|
|||
jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) {
|
||||
auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod,
|
||||
Common::Android::ToJDouble(env, max),
|
||||
Common::Android::ToJDouble(env, progress));
|
||||
Common::Android::ToJLong(env, max),
|
||||
Common::Android::ToJLong(env, progress));
|
||||
return Common::Android::GetJBoolean(env, jwasCancelled);
|
||||
};
|
||||
auto& session = EmulationSession::GetInstance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue