mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1127464 - Assert when we unexpectedly unload libraries on Android r=glandium
This commit is contained in:
parent
0f25e1ef1d
commit
64e282f344
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user