summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2017-11-09 22:03:17 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-11-09 22:03:17 +0000
commit0c911c0c5aa495ff01bf2d9e20834a92d6179c4e (patch)
treecbee2b9e66573321b6c7057f16a8397d6e0064c7
parent0862437df4238a7e4b21e258e84c33666125c230 (diff)
parent01be49fc9e6d7c60764daa8c813829a671a1c48f (diff)
Merge "Fix sanitizer in surfaceflinger waitForEvent."
-rw-r--r--services/surfaceflinger/EventThread.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index a9bb2ba0e1..f647742e2c 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -248,7 +248,7 @@ Vector< sp<EventThread::Connection> > EventThread::waitForEvent(
// find out connections waiting for events
size_t count = mDisplayEventConnections.size();
- for (size_t i=0 ; i<count ; i++) {
+ for (size_t i=0 ; i<count ; ) {
sp<Connection> connection(mDisplayEventConnections[i].promote());
if (connection != NULL) {
bool added = false;
@@ -279,11 +279,12 @@ Vector< sp<EventThread::Connection> > EventThread::waitForEvent(
// messages.
signalConnections.add(connection);
}
+ ++i;
} else {
// we couldn't promote this reference, the connection has
// died, so clean-up!
mDisplayEventConnections.removeAt(i);
- --i; --count;
+ --count;
}
}