Loading adb/transport.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -603,15 +603,15 @@ static void remove_transport(atransport* transport) { static void transport_unref(atransport* t) { CHECK(t != nullptr); std::lock_guard<std::mutex> lock(transport_lock); CHECK_GT(t->ref_count, 0u); t->ref_count--; if (t->ref_count == 0) { size_t old_refcount = t->ref_count--; CHECK_GT(old_refcount, 0u); if (old_refcount == 1u) { D("transport: %s unref (kicking and closing)", t->serial); t->close(t); remove_transport(t); } else { D("transport: %s unref (count=%zu)", t->serial, t->ref_count); D("transport: %s unref (count=%zu)", t->serial, old_refcount - 1); } } Loading adb/transport.h +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public: // class in one go is a very large change. Given how bad our testing is, // it's better to do this piece by piece. atransport(ConnectionState state = kCsOffline) : connection_state_(state) { atransport(ConnectionState state = kCsOffline) : ref_count(0), connection_state_(state) { transport_fde = {}; protocol_version = A_VERSION; max_payload = MAX_PAYLOAD; Loading @@ -88,7 +88,7 @@ public: int fd = -1; int transport_socket = -1; fdevent transport_fde; size_t ref_count = 0; std::atomic<size_t> ref_count; uint32_t sync_token = 0; bool online = false; TransportType type = kTransportAny; Loading Loading
adb/transport.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -603,15 +603,15 @@ static void remove_transport(atransport* transport) { static void transport_unref(atransport* t) { CHECK(t != nullptr); std::lock_guard<std::mutex> lock(transport_lock); CHECK_GT(t->ref_count, 0u); t->ref_count--; if (t->ref_count == 0) { size_t old_refcount = t->ref_count--; CHECK_GT(old_refcount, 0u); if (old_refcount == 1u) { D("transport: %s unref (kicking and closing)", t->serial); t->close(t); remove_transport(t); } else { D("transport: %s unref (count=%zu)", t->serial, t->ref_count); D("transport: %s unref (count=%zu)", t->serial, old_refcount - 1); } } Loading
adb/transport.h +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public: // class in one go is a very large change. Given how bad our testing is, // it's better to do this piece by piece. atransport(ConnectionState state = kCsOffline) : connection_state_(state) { atransport(ConnectionState state = kCsOffline) : ref_count(0), connection_state_(state) { transport_fde = {}; protocol_version = A_VERSION; max_payload = MAX_PAYLOAD; Loading @@ -88,7 +88,7 @@ public: int fd = -1; int transport_socket = -1; fdevent transport_fde; size_t ref_count = 0; std::atomic<size_t> ref_count; uint32_t sync_token = 0; bool online = false; TransportType type = kTransportAny; Loading