summaryrefslogtreecommitdiffstats
path: root/remoting/jingle_glue
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 18:50:52 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 18:50:52 +0000
commitb2055927c16828a1b49b8e836506a243efb610bf (patch)
tree06c5a53b4fdc7b551d3acf4f599053d747c845f2 /remoting/jingle_glue
parente977cd3d0f221526dd64375f2e56486837fe91f5 (diff)
downloadchromium_src-b2055927c16828a1b49b8e836506a243efb610bf.zip
chromium_src-b2055927c16828a1b49b8e836506a243efb610bf.tar.gz
chromium_src-b2055927c16828a1b49b8e836506a243efb610bf.tar.bz2
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
Diffstat (limited to 'remoting/jingle_glue')
-rw-r--r--remoting/jingle_glue/xmpp_signal_strategy.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc
index 5179aa1..c31d323 100644
--- a/remoting/jingle_glue/xmpp_signal_strategy.cc
+++ b/remoting/jingle_glue/xmpp_signal_strategy.cc
@@ -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() {