From 12d7f0909a4332c0f03ea0bd49741cc6c46a2353 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Fri, 28 Aug 2015 11:39:37 -0700 Subject: [PATCH] adb: call run_transport_disconnects() only once. Currently run_transport_disconnects() are called twice. One is in handle_offline(), another is before destroying transport. The users of disconnect callback are listener, adb_auth_client, and remote_sockets. All of them need only to be called once. And after handle_offline, no new listeners, adb_auth_client, or remote_sockets can be connected to the offlined transport. So I think we can remove the second call to run_transport_disconnects(). Change-Id: I1ef8b6b7b5ab7ae1bad109be107c85973d65a2e3 --- adb/transport.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/adb/transport.cpp b/adb/transport.cpp index 46c709f7e..4dc5e4a1e 100644 --- a/adb/transport.cpp +++ b/adb/transport.cpp @@ -536,8 +536,6 @@ static void transport_registration_func(int _fd, unsigned ev, void *data) transport_list.remove(t); adb_mutex_unlock(&transport_lock); - run_transport_disconnects(t); - if (t->product) free(t->product); if (t->serial)