# HG changeset patch # User Sam Lantinga # Date 1294951019 28800 # Node ID a21501393bef66533c8471cc002fa9806488de09 # Parent 8d7315668e35d2501e7147428733fab30a72dc72 Removed code from GetPrimtiveArrayCritical() experiment diff -r 8d7315668e35 -r a21501393bef src/SDL_android.cpp --- a/src/SDL_android.cpp Thu Jan 13 12:32:55 2011 -0800 +++ b/src/SDL_android.cpp Thu Jan 13 12:36:59 2011 -0800 @@ -211,14 +211,11 @@ extern "C" void * Android_JNI_GetAudioBuffer() { - //jboolean isCopy = JNI_FALSE; - //audioBufferPinned = mAudioEnv->GetPrimitiveArrayCritical((jarray)audioBuffer, &isCopy); return audioBufferPinned; } extern "C" void Android_JNI_WriteAudioBuffer() { - //mAudioEnv->ReleasePrimitiveArrayCritical((jarray)audioBuffer, audioBufferPinned, 0); if (audioBuffer16Bit) { mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT); mAudioEnv->CallStaticVoidMethod(mActivityInstance, midAudioWriteShortBuffer, (jshortArray)audioBuffer); @@ -234,8 +231,11 @@ { mEnv->CallStaticVoidMethod(mActivityInstance, midAudioQuit); - mEnv->DeleteGlobalRef(audioBuffer); - audioBuffer = NULL; + if (audioBuffer) { + mEnv->DeleteGlobalRef(audioBuffer); + audioBuffer = NULL; + audioBufferPinned = NULL; + } } /* vi: set ts=4 sw=4 expandtab: */