summaryrefslogtreecommitdiffstats
path: root/chrome_frame/update_launcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/update_launcher.cc')
-rw-r--r--chrome_frame/update_launcher.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome_frame/update_launcher.cc b/chrome_frame/update_launcher.cc
index 439626d..bd7860e 100644
--- a/chrome_frame/update_launcher.cc
+++ b/chrome_frame/update_launcher.cc
@@ -8,6 +8,7 @@
#include <Shellapi.h>
#include "base/win/scoped_com_initializer.h"
+#include "base/win/scoped_comptr.h"
#include "google_update/google_update_idl.h"
namespace {
@@ -57,12 +58,10 @@ DWORD LaunchUpdateCommand(const std::wstring& command) {
base::win::ScopedCOMInitializer com_initializer;
if (com_initializer.succeeded()) {
- IProcessLauncher* ipl = NULL;
+ base::win::ScopedComPtr<IProcessLauncher> ipl;
HANDLE process = NULL;
- HRESULT hr = ::CoCreateInstance(__uuidof(ProcessLauncherClass), NULL,
- CLSCTX_ALL, __uuidof(IProcessLauncher),
- reinterpret_cast<void**>(&ipl));
+ HRESULT hr = ipl.CreateInstance(__uuidof(ProcessLauncherClass));
if (SUCCEEDED(hr)) {
ULONG_PTR phandle = NULL;
@@ -78,8 +77,6 @@ DWORD LaunchUpdateCommand(const std::wstring& command) {
if (process)
::CloseHandle(process);
- if (ipl)
- ipl->Release();
}
return exit_code;