Index: remoting/client/jni/chromoting_jni_runtime.cc |
diff --git a/remoting/client/jni/chromoting_jni_runtime.cc b/remoting/client/jni/chromoting_jni_runtime.cc |
index cb7dbb0e9865cb0fc78b5aa885c39e19bfcecdaa..88572e801b93e361c3647fb57ecf1ba3156ff202 100644 |
--- a/remoting/client/jni/chromoting_jni_runtime.cc |
+++ b/remoting/client/jni/chromoting_jni_runtime.cc |
@@ -53,21 +53,20 @@ static void LoadNative(JNIEnv* env, jclass clazz, jobject context) { |
remoting::ChromotingJniRuntime::GetInstance(); |
} |
-static jstring GetApiKey(JNIEnv* env, jclass clazz) { |
- return ConvertUTF8ToJavaString( |
- env, google_apis::GetAPIKey().c_str()).Release(); |
+static ScopedJavaLocalRef<jstring> GetApiKey(JNIEnv* env, jclass clazz) { |
+ return ConvertUTF8ToJavaString(env, google_apis::GetAPIKey().c_str()); |
} |
-static jstring GetClientId(JNIEnv* env, jclass clazz) { |
+static ScopedJavaLocalRef<jstring> GetClientId(JNIEnv* env, jclass clazz) { |
return ConvertUTF8ToJavaString( |
- env, google_apis::GetOAuth2ClientID( |
- google_apis::CLIENT_REMOTING).c_str()).Release(); |
+ env, |
+ google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING).c_str()); |
} |
-static jstring GetClientSecret(JNIEnv* env, jclass clazz) { |
+static ScopedJavaLocalRef<jstring> GetClientSecret(JNIEnv* env, jclass clazz) { |
return ConvertUTF8ToJavaString( |
- env, google_apis::GetOAuth2ClientSecret( |
- google_apis::CLIENT_REMOTING).c_str()).Release(); |
+ env, |
+ google_apis::GetOAuth2ClientSecret(google_apis::CLIENT_REMOTING).c_str()); |
} |
static void Connect(JNIEnv* env, |