Use std::optional instead of mbgl::optional (#911)
This commit is contained in:
@@ -20,12 +20,12 @@ bool attach_jni_thread(JavaVM* vm, JNIEnv** env, std::string threadName) {
|
||||
ret = vm->GetEnv(reinterpret_cast<void **>(env), JNI_VERSION_1_6);
|
||||
if (ret != JNI_OK) {
|
||||
if (ret != JNI_EDETACHED) {
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with %i", ret);
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with " + std::to_string(ret));
|
||||
throw std::runtime_error("GetEnv() failed");
|
||||
} else {
|
||||
ret = vm->AttachCurrentThread(env, &args);
|
||||
if (ret != JNI_OK) {
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "AttachCurrentThread() failed with %i", ret);
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "AttachCurrentThread() failed with " + std::to_string(ret));
|
||||
throw std::runtime_error("AttachCurrentThread() failed");
|
||||
}
|
||||
detach = true;
|
||||
@@ -43,7 +43,7 @@ void detach_jni_thread(JavaVM* vm, JNIEnv** env, bool detach) {
|
||||
|
||||
jint ret;
|
||||
if ((ret = vm->DetachCurrentThread()) != JNI_OK) {
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "DetachCurrentThread() failed with %i", ret);
|
||||
mbgl::Log::Error(mbgl::Event::JNI, "DetachCurrentThread() failed with " + std::to_string(ret));
|
||||
throw std::runtime_error("DetachCurrentThread() failed");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user