bug 746135 - PopLocalFrame won't be called if an error occurs in AudioRunnable::Run() r=snorp
authorBrad Lassey <blassey@mozilla.com>
Tue, 17 Apr 2012 09:59:22 -0400
changeset 91860 f96f490bedabbcf1a171253d95d38affd1c04cca
parent 91859 76291134483795ce68ef05ea9a89d03bf0c0eaca
child 91861 df9ea73ec1f4a437152e7a75c198f80803c4410b
push id22480
push useremorley@mozilla.com
push dateWed, 18 Apr 2012 00:48:48 +0000
treeherdermozilla-central@93dfd98900ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs746135
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 746135 - PopLocalFrame won't be called if an error occurs in AudioRunnable::Run() r=snorp
dom/plugins/base/android/ANPAudio.cpp
--- a/dom/plugins/base/android/ANPAudio.cpp
+++ b/dom/plugins/base/android/ANPAudio.cpp
@@ -138,19 +138,17 @@ public:
 
 NS_IMETHODIMP
 AudioRunnable::Run()
 {
   JNIEnv* jenv = GetJNIForThread();
   if (!jenv)
     return NS_ERROR_FAILURE;
 
-  if (jenv->PushLocalFrame(128)) {
-    return NS_ERROR_FAILURE;
-  }
+  mozilla::AndroidBridge::AutoLocalJNIFrame autoFrame(jenv);
 
   jbyteArray bytearray = jenv->NewByteArray(mTrack->bufferSize);
   if (!bytearray) {
     LOG("AudioRunnable:: Run.  Could not create bytearray");
     return NS_ERROR_FAILURE;
   }
 
   jbyte *byte = jenv->GetByteArrayElements(bytearray, NULL);
@@ -196,17 +194,16 @@ AudioRunnable::Run()
   }
 
   jenv->DeleteGlobalRef(mTrack->output_unit);
   jenv->DeleteGlobalRef(mTrack->at_class);
 
   free(mTrack);
 
   jenv->ReleaseByteArrayElements(bytearray, byte, 0);
-  jenv->PopLocalFrame(NULL);
 
   return NS_OK;
 }
 
 ANPAudioTrack*
 anp_audio_newTrack(uint32_t sampleRate,    // sampling rate in Hz
                    ANPSampleFormat format,
                    int channelCount,       // MONO=1, STEREO=2