Index: ui/base/dialogs/base_shell_dialog_win.cc |
=================================================================== |
--- ui/base/dialogs/base_shell_dialog_win.cc (revision 159813) |
+++ ui/base/dialogs/base_shell_dialog_win.cc (working copy) |
@@ -7,6 +7,7 @@ |
#include <algorithm> |
#include "base/threading/thread.h" |
+#include "base/win/scoped_com_initializer.h" |
namespace { |
@@ -17,11 +18,12 @@ |
ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { } |
~ShellDialogThread(); |
- protected: |
+ private: |
void Init(); |
void CleanUp(); |
- private: |
+ scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ShellDialogThread); |
}; |
@@ -30,14 +32,11 @@ |
} |
void ShellDialogThread::Init() { |
- // Initializes the COM library on the current thread. |
- CoInitialize(NULL); |
+ com_initializer_.reset(new base::win::ScopedCOMInitializer()); |
} |
void ShellDialogThread::CleanUp() { |
- // Closes the COM library on the current thread. CoInitialize must |
- // be balanced by a corresponding call to CoUninitialize. |
- CoUninitialize(); |
+ com_initializer_.reset(); |
} |
} // namespace |