Commit b2055927 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Fix destruction order in XmppSignalStrategy.

This fixes a crash that was introduced in crrev.com/148803. Specifically 
when XMPP authentication fails. It may or may not fix the crash in the 
linked bug.

BUG=140096


Review URL: https://chromiumcodereview.appspot.com/10850008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149662 0039d316-1c4b-4281-b951-d872f2087c98
parent e977cd3d
......@@ -5,8 +5,11 @@
#include "remoting/jingle_glue/xmpp_signal_strategy.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/string_util.h"
#include "base/thread_task_runner_handle.h"
#include "jingle/glue/chrome_async_socket.h"
#include "jingle/glue/task_pump.h"
#include "jingle/glue/xmpp_client_socket_factory.h"
......@@ -55,6 +58,12 @@ XmppSignalStrategy::XmppSignalStrategy(
XmppSignalStrategy::~XmppSignalStrategy() {
Disconnect();
// Destroying task runner will destroy XmppClient, but XmppClient may be on
// the stack and it doesn't handle this case properly, so we need to delay
// destruction.
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
FROM_HERE, task_runner_.release());
}
void XmppSignalStrategy::Connect() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment