summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2017-12-21 01:09:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-12-21 01:09:29 +0000
commita7b2ac212a47bd6fb697ac8c96bfafbd124e1873 (patch)
tree8ded919f454659feb2c92c44f7c19ef87fc84ec6
parent630fcaf0abf3b2a925120623aac903b736798bd8 (diff)
parent0b3162a8e938487ddc966a4ead908ad1b0d874e6 (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;
}
}