--- a/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Fri Jun 24 13:14:03 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Fri Jun 24 13:19:32 2011 +0200
@@ -24,12 +24,14 @@
//Get the String array from java
int argc = env->GetArrayLength(strArray);
- char* argv[argc];
+ char *argv[argc];
jstring jstringArgv[argc];
for(int i = 0; i < argc; i++){
jstringArgv[i] = (jstring)env->GetObjectArrayElement(strArray, i); //get the element
+ argv[i] = (char*)malloc(sizeof(char) * env->GetStringLength(jstringArgv[i]));
strcpy(argv[i], env->GetStringUTFChars(jstringArgv[i], JNI_FALSE)); //copy it to a mutable location
- env->ReleaseStringChars(jstringArgv[i], (jchar*)argv[i]); //release mem
+ //Don't release memory the JAVA GC will take care of it
+ //env->ReleaseStringChars(jstringArgv[i], (jchar*)argv[i]);
}
/* Run the application code! */