Skip to content

Commit 342297c

Browse files
authored
Merge pull request #436 from cardinalblue/master
make sure the runOnDraw operation is thread-safe
2 parents c4f55c6 + 3fb9451 commit 342297c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

library/src/main/java/jp/co/cyberagent/android/gpuimage/filter/GPUImageFilter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ protected void onDrawArraysPre() {
135135
}
136136

137137
protected void runPendingOnDrawTasks() {
138-
while (!runOnDraw.isEmpty()) {
139-
runOnDraw.removeFirst().run();
138+
synchronized (runOnDraw) {
139+
while (!runOnDraw.isEmpty()) {
140+
runOnDraw.removeFirst().run();
141+
}
140142
}
141143
}
142144

0 commit comments

Comments
 (0)