From 75cb3dc5f2a104261e5a86e3cb1cf1a42cf355c0 Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Fri, 23 May 2014 23:13:35 +0000 Subject: [PATCH] (Auto)update libjingle 67869540-> 67872893 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6243 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/examples/call/console.cc | 12 ++++++++---- talk/examples/call/console.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/talk/examples/call/console.cc b/talk/examples/call/console.cc index 9ad8bc754..992d0562c 100644 --- a/talk/examples/call/console.cc +++ b/talk/examples/call/console.cc @@ -48,28 +48,29 @@ static void DoNothing(int unused) {} Console::Console(talk_base::Thread *thread, CallClient *client) : client_(client), client_thread_(thread), - console_thread_(new talk_base::Thread()) {} + stopped_(false) {} Console::~Console() { Stop(); } void Console::Start() { - if (!console_thread_) { + if (stopped_) { // stdin was closed in Stop(), so we can't restart. LOG(LS_ERROR) << "Cannot re-start"; return; } - if (console_thread_->started()) { + if (console_thread_) { LOG(LS_WARNING) << "Already started"; return; } + console_thread_.reset(new talk_base::Thread()); console_thread_->Start(); console_thread_->Post(this, MSG_START); } void Console::Stop() { - if (console_thread_ && console_thread_->started()) { + if (console_thread_) { #ifdef WIN32 CloseHandle(GetStdHandle(STD_INPUT_HANDLE)); #else @@ -80,6 +81,7 @@ void Console::Stop() { #endif console_thread_->Stop(); console_thread_.reset(); + stopped_ = true; } } @@ -165,3 +167,5 @@ void Console::OnMessage(talk_base::Message *msg) { break; } } + +} diff --git a/talk/examples/call/console.h b/talk/examples/call/console.h index 589603896..f0f36e346 100644 --- a/talk/examples/call/console.h +++ b/talk/examples/call/console.h @@ -64,6 +64,7 @@ class Console : public talk_base::MessageHandler { CallClient *client_; talk_base::Thread *client_thread_; talk_base::scoped_ptr console_thread_; + bool stopped_; }; #endif // TALK_EXAMPLES_CALL_CONSOLE_H_