Bug 1335235: Add disabling of the COM BSTR cache to mscom::MainThreadRuntime; r=jimm

MozReview-Commit-ID: 5RQvHiBoD2B

--HG--
extra : rebase_source : 52425f3e5838939d17c29729caf70534212c328a
This commit is contained in:
Aaron Klotz 2017-01-30 16:39:08 -07:00
Родитель f912e21d23
Коммит 3ef6514406
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -30,6 +30,9 @@ struct LocalFreeDeleter
} // anonymous namespace
// This API from oleaut32.dll is not declared in Windows SDK headers
extern "C" void __cdecl SetOaNoCache(void);
namespace mozilla {
namespace mscom {
@ -59,9 +62,13 @@ MainThreadRuntime::MainThreadRuntime()
return;
}
// Disable COM's catch-all exception handler
mInitResult = globalOpts->Set(COMGLB_EXCEPTION_HANDLING,
COMGLB_EXCEPTION_DONOT_HANDLE_ANY);
MOZ_ASSERT(SUCCEEDED(mInitResult));
// Disable the BSTR cache (as it never invalidates, thus leaking memory)
::SetOaNoCache();
}
HRESULT