diff --git a/src/core/platform-helpers/android-platform-helpers.cpp b/src/core/platform-helpers/android-platform-helpers.cpp index 194e72275..9123fb1ef 100644 --- a/src/core/platform-helpers/android-platform-helpers.cpp +++ b/src/core/platform-helpers/android-platform-helpers.cpp @@ -181,18 +181,18 @@ string AndroidPlatformHelpers::getDataPath () { JNIEnv *env = ms_get_jni_env(); jstring jdata_path = (jstring)env->CallObjectMethod(mJavaHelper, mGetDataPathId); const char *data_path = GetStringUTFChars(env, jdata_path); - string dataPath = data_path + "/"; + string dataPath = data_path; ReleaseStringUTFChars(env, jdata_path, data_path); - return dataPath; + return dataPath + "/"; } string AndroidPlatformHelpers::getConfigPath () { JNIEnv *env = ms_get_jni_env(); jstring jconfig_path = (jstring)env->CallObjectMethod(mJavaHelper, mGetConfigPathId); const char *config_path = GetStringUTFChars(env, jconfig_path); - string configPath = config_path + "/"; + string configPath = config_path; ReleaseStringUTFChars(env, jconfig_path, config_path); - return configPath; + return configPath + "/"; } int AndroidPlatformHelpers::callVoidMethod (jmethodID id) {