bug 636968 - check windows API calls for failure in InitDwriteBG. r=jdaggett a=roc
authorJonathan Kew <jfkthame@gmail.com>
Mon, 28 Feb 2011 09:55:14 +0000
changeset 63164 f7de2d1130962c176ef6dc3f82a014cc3af502b4
parent 63163 554fa6c29f0788b52ceead2f9012b0c623ad85f5
child 63165 1cb5acba0d4f86dd5accfcbb36e6d14f8ae8bfea
push id19052
push userjkew@mozilla.com
push dateMon, 28 Feb 2011 09:56:14 +0000
treeherdermozilla-central@f7de2d113096 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett, roc
bugs636968
milestone2.0b13pre
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 636968 - check windows API calls for failure in InitDwriteBG. r=jdaggett a=roc
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2757,29 +2757,34 @@ static void LogRegistryEvent(const wchar
 
 #endif
 
 static DWORD InitDwriteBG(LPVOID lpdwThreadParam)
 {
   SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
   LOGREGISTRY(L"loading dwrite.dll");
   HMODULE dwdll = LoadLibraryW(L"dwrite.dll");
-  DWriteCreateFactoryFunc createDWriteFactory = (DWriteCreateFactoryFunc)
-    GetProcAddress(dwdll, "DWriteCreateFactory");
-  if (createDWriteFactory) {
-    LOGREGISTRY(L"creating dwrite factory");
-    IDWriteFactory *factory;
-    HRESULT hr = createDWriteFactory(
-      DWRITE_FACTORY_TYPE_SHARED,
-      __uuidof(IDWriteFactory),
-      reinterpret_cast<IUnknown**>(&factory));
-    
-    LOGREGISTRY(L"dwrite factory done");
-    factory->Release();
-    LOGREGISTRY(L"freed factory");
+  if (dwdll) {
+    DWriteCreateFactoryFunc createDWriteFactory = (DWriteCreateFactoryFunc)
+      GetProcAddress(dwdll, "DWriteCreateFactory");
+    if (createDWriteFactory) {
+      LOGREGISTRY(L"creating dwrite factory");
+      IDWriteFactory *factory;
+      HRESULT hr = createDWriteFactory(
+        DWRITE_FACTORY_TYPE_SHARED,
+        __uuidof(IDWriteFactory),
+        reinterpret_cast<IUnknown**>(&factory));
+      if (SUCCEEDED(hr)) {
+        LOGREGISTRY(L"dwrite factory done");
+        factory->Release();
+        LOGREGISTRY(L"freed factory");
+      } else {
+        LOGREGISTRY(L"failed to create factory");
+      }
+    }
   }
   SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_END);
   return 0;
 }
 #endif
 
 PRTime gXRE_mainTimestamp = 0;