Skip to content

Commit f703e80

Browse files
committed
refactor: rename JavaGlobalRef variable
1 parent 2498fcc commit f703e80

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

dart_native/android/src/main/jni/dn_method_call.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,3 @@ void *callNativeStringMethod(JNIEnv *env, jobject object, jmethodID methodId, jv
7373
auto javaString = (jstring)env->CallObjectMethodA(object, methodId, arguments);
7474
return convertToDartUtf16(env, javaString);
7575
}
76-
77-
void *callNativeObjectMethod(JNIEnv *env, jobject object, jmethodID methodId, jvalue *arguments)
78-
{
79-
}

dart_native/android/src/main/jni/dn_method_call.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extern "C"
2727
void *callNativeVoidMethod(JNIEnv *env, jobject object, jmethodID methodId, jvalue *arguments);
2828

2929
void *callNativeStringMethod(JNIEnv *env, jobject object, jmethodID methodId, jvalue *arguments);
30-
void *callNativeObjectMethod(JNIEnv *env, jobject object, jmethodID methodId, jvalue *arguments);
3130

3231
const std::map<char, std::function<CallNativeMethod> > methodCallerMap = {
3332
{'C', callNativeCharMethod},

dart_native/android/src/main/jni/jni_object_ref.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
template <typename T>
1414
class JavaGlobalRef {
1515
public:
16-
explicit JavaGlobalRef(T obj, JNIEnv *env): env_(env) {
17-
this->obj_ = env->NewGlobalRef(obj);
16+
explicit JavaGlobalRef(T t, JNIEnv *env): env(env) {
17+
this->obj = env->NewGlobalRef(t);
1818
}
1919

2020
JavaGlobalRef() = delete;
2121

22-
T Object() const { return static_cast<T>(obj_); }
22+
T Object() const { return static_cast<T>(obj); }
2323

2424
~JavaGlobalRef() { this->DeleteGlobalRef(); }
2525

2626
protected:
27-
jobject obj_ = nullptr;
27+
jobject obj = nullptr;
2828

2929
private:
30-
JNIEnv *env_;
30+
JNIEnv *env;
3131

3232
void DeleteGlobalRef() {
33-
if (this->obj_) {
34-
env_->DeleteGlobalRef(this->obj_);
35-
this->obj_ = nullptr;
33+
if (this->obj) {
34+
env->DeleteGlobalRef(this->obj);
35+
this->obj = nullptr;
3636
}
3737
}
3838
};

0 commit comments

Comments
 (0)