From 51718596075d217dc0c8ffdb6bd624fe068fd0c9 Mon Sep 17 00:00:00 2001 From: "kalman@chromium.org" Date: Fri, 21 Oct 2011 06:21:57 +0000 Subject: Make MessageLoop::QuitClosure call Quit of the current MessageLoop at call time, not the current MessageLoop at the Closure's creation time. This brings the behaviour of QuitClosure in line with QuitTask. BUG= TEST= Review URL: http://codereview.chromium.org/8354032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106684 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_loop.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/message_loop.cc b/base/message_loop.cc index f2e07b9..45bad48 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -365,10 +365,13 @@ void MessageLoop::QuitNow() { } } +static void QuitCurrent() { + MessageLoop::current()->Quit(); +} + // static base::Closure MessageLoop::QuitClosure() { - return base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoop::current())); + return base::Bind(&QuitCurrent); } void MessageLoop::SetNestableTasksAllowed(bool allowed) { -- cgit v1.1