diff options
author | Shimeng (Simon) Wang <swang@google.com> | 2011-01-14 11:11:18 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-14 11:11:18 -0800 |
commit | dac52a1b6f0c401bccca1e5713f782a8b26345b3 (patch) | |
tree | 0e1ebb5bb570cfea46845994c9fc108a0902c110 /android | |
parent | a01ff25d304217e7ef77ad2d83f48aca73be2c9d (diff) | |
parent | a7efc89ca675fa953f8d203d66e5cfa584f27910 (diff) | |
download | external_chromium-dac52a1b6f0c401bccca1e5713f782a8b26345b3.zip external_chromium-dac52a1b6f0c401bccca1e5713f782a8b26345b3.tar.gz external_chromium-dac52a1b6f0c401bccca1e5713f782a8b26345b3.tar.bz2 |
Merge "Use current thread's JNIEnv." into honeycomb
Diffstat (limited to 'android')
-rw-r--r-- | android/app/l10n_util.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/android/app/l10n_util.cc b/android/app/l10n_util.cc index 2651c56..9ea87e8 100644 --- a/android/app/l10n_util.cc +++ b/android/app/l10n_util.cc @@ -52,8 +52,13 @@ JNIHelper::JNIHelper() JNIHelper::~JNIHelper() { - if (mEnv) - mEnv->DeleteGlobalRef(mClassRef); + if (mEnv) { + // Because the stored mEnv could be bad during c++ destruction phase + // since it's thread local. + JNIEnv* currentEnv = android::GetJNIEnv(); + if (currentEnv) + currentEnv->DeleteGlobalRef(mClassRef); + } } string16 JNIHelper::getLocalisedString(int message_id) |