Skip to content

Commit 0438ee0

Browse files
SessionHero01SessionHero01
authored andcommitted
Tidy up
1 parent fb66453 commit 0438ee0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

library/src/main/cpp/config_base.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ Java_network_loki_messenger_libsession_1util_ConfigBase_confirmPushed(JNIEnv *en
7575
std::unordered_set<std::string> hashes(hash_list_size);
7676

7777
for (int i = 0; i < hash_list_size; i++) {
78-
auto hash_jstring = (jstring) env->GetObjectArrayElement(hash_list, i);
79-
auto hash = env->GetStringUTFChars(hash_jstring, nullptr);
78+
auto hash_jstring = jni_utils::JavaLocalRef(env, (jstring) env->GetObjectArrayElement(hash_list, i));
79+
auto hash = env->GetStringUTFChars(hash_jstring.get(), nullptr);
8080
hashes.insert(hash);
81-
env->ReleaseStringUTFChars(hash_jstring, hash);
82-
env->DeleteLocalRef(hash_jstring);
81+
env->ReleaseStringUTFChars(hash_jstring.get(), hash);
8382
}
8483

8584
conf->confirm_pushed(seq_no, hashes);

0 commit comments

Comments
 (0)