OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 554 } |
555 | 555 |
556 AutoThread::~AutoThread() { | 556 AutoThread::~AutoThread() { |
557 Stop(); | 557 Stop(); |
558 if (ThreadManager::Instance()->CurrentThread() == this) { | 558 if (ThreadManager::Instance()->CurrentThread() == this) { |
559 ThreadManager::Instance()->SetCurrentThread(NULL); | 559 ThreadManager::Instance()->SetCurrentThread(NULL); |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 #if defined(WEBRTC_WIN) | 563 #if defined(WEBRTC_WIN) |
| 564 ComThread::~ComThread() { |
| 565 Stop(); |
| 566 } |
| 567 |
564 void ComThread::Run() { | 568 void ComThread::Run() { |
565 HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); | 569 HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); |
566 RTC_DCHECK(SUCCEEDED(hr)); | 570 RTC_DCHECK(SUCCEEDED(hr)); |
567 if (SUCCEEDED(hr)) { | 571 if (SUCCEEDED(hr)) { |
568 Thread::Run(); | 572 Thread::Run(); |
569 CoUninitialize(); | 573 CoUninitialize(); |
570 } else { | 574 } else { |
571 LOG(LS_ERROR) << "CoInitialize failed, hr=" << hr; | 575 LOG(LS_ERROR) << "CoInitialize failed, hr=" << hr; |
572 } | 576 } |
573 } | 577 } |
574 #endif | 578 #endif |
575 | 579 |
576 } // namespace rtc | 580 } // namespace rtc |
OLD | NEW |