diff options
-rw-r--r-- | chrome/common/win_util.cc | 9 | ||||
-rw-r--r-- | chrome/common/win_util.h | 9 |
2 files changed, 7 insertions, 11 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc index 6af0db8..1c552a2 100644 --- a/chrome/common/win_util.cc +++ b/chrome/common/win_util.cc @@ -82,15 +82,6 @@ UINT_PTR CALLBACK SaveAsDialogHook(HWND dialog, UINT message, } // namespace -ScopedCOMInitializer::ScopedCOMInitializer() : hr_(CoInitialize(NULL)) { - DCHECK(hr_ != RPC_E_CHANGED_MODE) << "thread already initialized as MTA"; -} - -ScopedCOMInitializer::~ScopedCOMInitializer() { - if (SUCCEEDED(hr_)) - CoUninitialize(); -} - std::wstring FormatSystemTime(const SYSTEMTIME& time, const std::wstring& format) { // If the format string is empty, just use the default format. diff --git a/chrome/common/win_util.h b/chrome/common/win_util.h index 02a8ace..5de3329 100644 --- a/chrome/common/win_util.h +++ b/chrome/common/win_util.h @@ -61,8 +61,13 @@ class CoMemReleaser { // destructor. class ScopedCOMInitializer { public: - ScopedCOMInitializer(); - ~ScopedCOMInitializer(); + ScopedCOMInitializer() : hr_(CoInitialize(NULL)) { + } + + ScopedCOMInitializer::~ScopedCOMInitializer() { + if (SUCCEEDED(hr_)) + CoUninitialize(); + } // Returns the error code from CoInitialize(NULL) // (called in constructor) |