зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1127464 - Assert when we unexpectedly unload libraries on Android r=glandium
This commit is contained in:
Родитель
1c1e3bb26f
Коммит
47ca1c6198
|
@ -403,7 +403,9 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, js
|
|||
char *args = (char *) malloc(len + 1);
|
||||
jenv->GetStringUTFRegion(jargs, 0, len, args);
|
||||
args[len] = '\0';
|
||||
ElfLoader::Singleton.ExpectShutdown(false);
|
||||
GeckoStart(args, &sAppData);
|
||||
ElfLoader::Singleton.ExpectShutdown(true);
|
||||
free(args);
|
||||
}
|
||||
|
||||
|
|
|
@ -510,6 +510,10 @@ ElfLoader::~ElfLoader()
|
|||
{
|
||||
LibHandleList list;
|
||||
|
||||
if (!Singleton.IsShutdownExpected()) {
|
||||
MOZ_CRASH("Unexpected shutdown");
|
||||
}
|
||||
|
||||
/* Release self_elf and libc */
|
||||
self_elf = nullptr;
|
||||
#if defined(ANDROID)
|
||||
|
|
|
@ -431,6 +431,12 @@ public:
|
|||
*/
|
||||
static Mappable *GetMappableFromPath(const char *path);
|
||||
|
||||
void ExpectShutdown(bool val) { expect_shutdown = val; }
|
||||
bool IsShutdownExpected() { return expect_shutdown; }
|
||||
|
||||
private:
|
||||
bool expect_shutdown;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Registers the given handle. This method is meant to be called by
|
||||
|
@ -454,6 +460,7 @@ protected:
|
|||
const char *lastError;
|
||||
|
||||
private:
|
||||
ElfLoader() : expect_shutdown(true) {}
|
||||
~ElfLoader();
|
||||
|
||||
/* Initialization code that can't run during static initialization. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче