Browse Source

fallback to nss3.dll is mozalloc isn't found
* this is so standalone (bk test in komodo) can run

toddw 9 years ago
parent
commit
0c57798a05
1 changed files with 8 additions and 3 deletions
  1. 8 3
      xpcom/src/module/_xpcom.cpp

+ 8 - 3
xpcom/src/module/_xpcom.cpp

@@ -118,12 +118,17 @@ static bool GetModulePath(char dest[MAXPATHLEN], const char* moduleName) {
 		// on, and assume it lives in that bin dir.  Different
 		// moz build types (eg, xulrunner, suite) package
 		// XPCOM itself differently - but all appear to require
-		// mozalloc.dll - so this is what we use.
+		// mozalloc.dll or nss3.dll - so this is what we use.
 		wchar_t landmark[MAXPATHLEN];
 		HMODULE hmod = GetModuleHandle("mozalloc.dll");
 		if (!hmod) {
-			PyErr_SetString(PyExc_RuntimeError, "We dont appear to be linked against mozalloc.dll.");
-			return false;
+			DUMP("no malloc, trying for nss3.dll\n");
+			// Try for nss3 then.
+			hmod = GetModuleHandle("nss3.dll");
+			if (!hmod) {
+				PyErr_SetString(PyExc_RuntimeError, "We dont appear to be linked against mozalloc.dll.");
+				return false;
+			}
 		}
 		GetModuleFileNameW(hmod, landmark, sizeof(landmark)/sizeof(landmark[0]));
 		landmark[sizeof(landmark)/sizeof(landmark[0]) - 1] = L'\0';