Skip to content

Commit

Permalink
fix(ndk): Free cache instances when unneeded
Browse files Browse the repository at this point in the history
  • Loading branch information
kattrali committed Apr 11, 2019
1 parent d5106da commit ceb011c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ndk/src/main/jni/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void bsg_populate_crumb_metadata(JNIEnv *env, bugsnag_breadcrumb *crumb,
(*env)->ReleaseStringUTFChars(env, _key, key);
(*env)->ReleaseStringUTFChars(env, _value, value);
}
free(jni_cache);
(*env)->DeleteLocalRef(env, keyset);
(*env)->DeleteLocalRef(env, keylist);
}
Expand Down Expand Up @@ -333,6 +334,7 @@ void bsg_populate_report(JNIEnv *env, bugsnag_report *report) {
bsg_populate_app_data(env, jni_cache, report);
bsg_populate_device_data(env, jni_cache, report);
bsg_populate_user_data(env, jni_cache, report);
free(jni_cache);
}
void bsg_populate_metadata(JNIEnv *env, bugsnag_report *report,
jobject metadata) {
Expand Down Expand Up @@ -392,4 +394,5 @@ void bsg_populate_metadata(JNIEnv *env, bugsnag_report *report,
} else {
report->metadata.value_count = 0;
}
free(jni_cache);
}

0 comments on commit ceb011c

Please sign in to comment.