Bug 735344 - Use a refcounted pointer to Zip so that the delete doesn't crash Fennec. Also remove some spurious logging. r=glandium
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 13 Mar 2012 14:59:53 -0400
changeset 88964 9b09f6e06408162bc2be6aa958c7019178f4c0f6
parent 88963 4960666240eeb656de5b8d3f467141e8e22cee74
child 88965 342d9abc7213f2a755b69d53175f2807384f1d49
push id7087
push userkgupta@mozilla.com
push dateTue, 13 Mar 2012 19:01:04 +0000
treeherdermozilla-inbound@9b09f6e06408 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs735344
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 735344 - Use a refcounted pointer to Zip so that the delete doesn't crash Fennec. Also remove some spurious logging. r=glandium
mozglue/android/APKOpen.cpp
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -718,27 +718,26 @@ static int loadSQLiteLibs(const char *ap
 
   setup_sqlite_functions(sqlite_handle);
   return SUCCESS;
 }
 
 static mozglueresult
 loadNSSLibs(const char *apkName)
 {
-  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs");
   chdir(getenv("GRE_HOME"));
 
 #ifdef MOZ_OLD_LINKER
   if (!simple_linker_initialized) {
     simple_linker_init();
     simple_linker_initialized = true;
   }
 #endif
 
-  Zip *zip = new Zip(apkName);
+  RefPtr<Zip> zip = new Zip(apkName);
   if (!lib_mapping) {
     lib_mapping = (struct mapping_info *)calloc(MAX_MAPPING_INFO, sizeof(*lib_mapping));
   }
 
 #ifdef MOZ_CRASHREPORTER
   file_ids = (char *)extractBuf("lib.id", zip);
 #endif
 
@@ -767,40 +766,36 @@ loadNSSLibs(const char *apkName)
   MOZLOAD("ssl3");
   MOZLOAD("smime3");
   MOZLOAD("nssckbi");
   MOZLOAD("freebl3");
   MOZLOAD("softokn3");
 #undef MOZLOAD
 #endif
 
-  delete zip;
-
 #ifdef MOZ_CRASHREPORTER
   free(file_ids);
   file_ids = NULL;
 #endif
 
-  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs 2");
   if (!nss_handle) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnss3!");
     return FAILURE;
   }
 
   if (!nspr_handle) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnspr4!");
     return FAILURE;
   }
 
   if (!plc_handle) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libplc4!");
     return FAILURE;
   }
 
-  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "loadNSSLibs 3");
   return setup_nss_functions(nss_handle, nspr_handle, plc_handle);
 }
 
 extern "C" NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_loadGeckoLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName)
 {
   const char* str;
   // XXX: java doesn't give us true UTF8, we should figure out something