Removed code from GetPrimtiveArrayCritical() experiment
authorSam Lantinga
Thu, 13 Jan 2011 12:36:59 -0800
changeset 4997a21501393bef
parent 4996 8d7315668e35
child 4998 a514bfe6952a
Removed code from GetPrimtiveArrayCritical() experiment
src/SDL_android.cpp
     1.1 --- a/src/SDL_android.cpp	Thu Jan 13 12:32:55 2011 -0800
     1.2 +++ b/src/SDL_android.cpp	Thu Jan 13 12:36:59 2011 -0800
     1.3 @@ -211,14 +211,11 @@
     1.4  
     1.5  extern "C" void * Android_JNI_GetAudioBuffer()
     1.6  {
     1.7 -    //jboolean isCopy = JNI_FALSE;
     1.8 -    //audioBufferPinned = mAudioEnv->GetPrimitiveArrayCritical((jarray)audioBuffer, &isCopy);
     1.9      return audioBufferPinned;
    1.10  }
    1.11  
    1.12  extern "C" void Android_JNI_WriteAudioBuffer()
    1.13  {
    1.14 -    //mAudioEnv->ReleasePrimitiveArrayCritical((jarray)audioBuffer, audioBufferPinned, 0);
    1.15      if (audioBuffer16Bit) {
    1.16          mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
    1.17          mAudioEnv->CallStaticVoidMethod(mActivityInstance, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
    1.18 @@ -234,8 +231,11 @@
    1.19  {
    1.20      mEnv->CallStaticVoidMethod(mActivityInstance, midAudioQuit); 
    1.21  
    1.22 -    mEnv->DeleteGlobalRef(audioBuffer);
    1.23 -    audioBuffer = NULL;
    1.24 +    if (audioBuffer) {
    1.25 +        mEnv->DeleteGlobalRef(audioBuffer);
    1.26 +        audioBuffer = NULL;
    1.27 +        audioBufferPinned = NULL;
    1.28 +    }
    1.29  }
    1.30  
    1.31  /* vi: set ts=4 sw=4 expandtab: */