changeset 4997:a21501393bef

Removed code from GetPrimtiveArrayCritical() experiment
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jan 2011 12:36:59 -0800
parents 8d7315668e35
children a514bfe6952a
files src/SDL_android.cpp
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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: */