Bug 735344 - Use a refcounted pointer to Zip so that the delete doesn't crash Fennec. Also remove some spurious logging. r=glandium

This commit is contained in:
Kartikaya Gupta 2012-03-13 14:59:53 -04:00
Родитель 4291a6ccc4
Коммит b448de886d
1 изменённых файлов: 1 добавлений и 6 удалений

Просмотреть файл

@ -723,7 +723,6 @@ static int loadSQLiteLibs(const char *apkName)
static mozglueresult static mozglueresult
loadNSSLibs(const char *apkName) loadNSSLibs(const char *apkName)
{ {
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs");
chdir(getenv("GRE_HOME")); chdir(getenv("GRE_HOME"));
#ifdef MOZ_OLD_LINKER #ifdef MOZ_OLD_LINKER
@ -733,7 +732,7 @@ loadNSSLibs(const char *apkName)
} }
#endif #endif
Zip *zip = new Zip(apkName); RefPtr<Zip> zip = new Zip(apkName);
if (!lib_mapping) { if (!lib_mapping) {
lib_mapping = (struct mapping_info *)calloc(MAX_MAPPING_INFO, sizeof(*lib_mapping)); lib_mapping = (struct mapping_info *)calloc(MAX_MAPPING_INFO, sizeof(*lib_mapping));
} }
@ -772,14 +771,11 @@ loadNSSLibs(const char *apkName)
#undef MOZLOAD #undef MOZLOAD
#endif #endif
delete zip;
#ifdef MOZ_CRASHREPORTER #ifdef MOZ_CRASHREPORTER
free(file_ids); free(file_ids);
file_ids = NULL; file_ids = NULL;
#endif #endif
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs 2");
if (!nss_handle) { if (!nss_handle) {
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnss3!"); __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnss3!");
return FAILURE; return FAILURE;
@ -795,7 +791,6 @@ loadNSSLibs(const char *apkName)
return FAILURE; return FAILURE;
} }
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs 3");
return setup_nss_functions(nss_handle, nspr_handle, plc_handle); return setup_nss_functions(nss_handle, nspr_handle, plc_handle);
} }