зеркало из https://github.com/mozilla/pjs.git
Bug 598197 - Don't setup audio when we can't get the JNIEnv, r=kinetik,blassey a=blocking-fennec
This commit is contained in:
Родитель
980f513ba4
Коммит
d28449abf9
|
@ -171,6 +171,9 @@ sa_stream_open(sa_stream_t *s) {
|
|||
}
|
||||
|
||||
JNIEnv *jenv = GetJNIForThread();
|
||||
if (!jenv)
|
||||
return SA_ERROR_NO_DEVICE;
|
||||
|
||||
if ((*jenv)->PushLocalFrame(jenv, 4)) {
|
||||
return SA_ERROR_OOM;
|
||||
}
|
||||
|
@ -208,6 +211,9 @@ sa_stream_destroy(sa_stream_t *s) {
|
|||
}
|
||||
|
||||
JNIEnv *jenv = GetJNIForThread();
|
||||
if (!jenv)
|
||||
return SA_SUCCESS;
|
||||
|
||||
(*jenv)->DeleteGlobalRef(jenv, s->output_unit);
|
||||
(*jenv)->DeleteGlobalRef(jenv, s->at_class);
|
||||
free(s);
|
||||
|
|
|
@ -85,7 +85,9 @@ public:
|
|||
}
|
||||
|
||||
static JNIEnv *JNIForThread() {
|
||||
return sBridge->AttachThread();
|
||||
if (NS_LIKELY(sBridge))
|
||||
return sBridge->AttachThread();
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// The bridge needs to be constructed via ConstructBridge first,
|
||||
|
|
Загрузка…
Ссылка в новой задаче