зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1309708 - [1.2] Delete reported library mapping on close. r=glandium
This commit is contained in:
Родитель
3c26921157
Коммит
73f2949cad
|
@ -199,6 +199,21 @@ report_mapping(char *name, void *base, uint32_t len, uint32_t offset)
|
|||
info->offset = offset;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
delete_mapping(const char *name)
|
||||
{
|
||||
for (int pos = 0; pos < mapping_count; ++pos) {
|
||||
struct mapping_info *info = &lib_mapping[pos];
|
||||
if (!strcmp(info->name, name)) {
|
||||
struct mapping_info *last = &lib_mapping[mapping_count - 1];
|
||||
free(info->name);
|
||||
*info = *last;
|
||||
--mapping_count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void*
|
||||
dlopenAPKLibrary(const char* apkName, const char* libraryName)
|
||||
{
|
||||
|
|
|
@ -23,9 +23,11 @@ using namespace mozilla;
|
|||
#ifdef ANDROID
|
||||
extern "C" {
|
||||
void report_mapping(char *name, void *base, uint32_t len, uint32_t offset);
|
||||
void delete_mapping(const char *name);
|
||||
}
|
||||
#else
|
||||
#define report_mapping(...)
|
||||
#define delete_mapping(...)
|
||||
#endif
|
||||
|
||||
const Ehdr *Ehdr::validate(const void *buf)
|
||||
|
@ -276,6 +278,7 @@ CustomElf::~CustomElf()
|
|||
* calls destructors once, so call it in all cases. */
|
||||
ElfLoader::__wrap_cxa_finalize(this);
|
||||
ElfLoader::Singleton.Forget(this);
|
||||
delete_mapping(GetName());
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "mozilla/RefPtr.h"
|
||||
|
||||
extern "C" void report_mapping() { }
|
||||
extern "C" void delete_mapping() { }
|
||||
|
||||
/**
|
||||
* test.zip is a basic test zip file with a central directory. It contains
|
||||
|
|
Загрузка…
Ссылка в новой задаче