зеркало из https://github.com/mozilla/gecko-dev.git
Bug 763166 - Fix race condition that could result in using an uninitialized AndroidBridge. r=snorp
This commit is contained in:
Родитель
083c6b4275
Коммит
c1e342445b
|
@ -59,7 +59,7 @@ class AndroidRefable {
|
|||
// This isn't in AndroidBridge.h because including StrongPointer.h there is gross
|
||||
static android::sp<AndroidRefable> (*android_SurfaceTexture_getNativeWindow)(JNIEnv* env, jobject surfaceTexture) = nullptr;
|
||||
|
||||
AndroidBridge *
|
||||
void
|
||||
AndroidBridge::ConstructBridge(JNIEnv *jEnv,
|
||||
jclass jGeckoAppShellClass)
|
||||
{
|
||||
|
@ -73,12 +73,11 @@ AndroidBridge::ConstructBridge(JNIEnv *jEnv,
|
|||
|
||||
PR_NewThreadPrivateIndex(&sJavaEnvThreadIndex, JavaThreadDetachFunc);
|
||||
|
||||
sBridge = new AndroidBridge();
|
||||
if (!sBridge->Init(jEnv, jGeckoAppShellClass)) {
|
||||
delete sBridge;
|
||||
sBridge = 0;
|
||||
AndroidBridge *bridge = new AndroidBridge();
|
||||
if (!bridge->Init(jEnv, jGeckoAppShellClass)) {
|
||||
delete bridge;
|
||||
}
|
||||
return sBridge;
|
||||
sBridge = bridge;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -101,8 +101,7 @@ public:
|
|||
LAYER_CLIENT_TYPE_GL = 2 // AndroidGeckoGLLayerClient
|
||||
};
|
||||
|
||||
static AndroidBridge *ConstructBridge(JNIEnv *jEnv,
|
||||
jclass jGeckoAppShellClass);
|
||||
static void ConstructBridge(JNIEnv *jEnv, jclass jGeckoAppShellClass);
|
||||
|
||||
static AndroidBridge *Bridge() {
|
||||
return sBridge;
|
||||
|
|
Загрузка…
Ссылка в новой задаче