Allow FirstFrameListeners to remove themselves from the FlutterView's list (flutter/engine#4871)

Fixes https://github.com/flutter/flutter/issues/15884
This commit is contained in:
Jason Simmons
2018-03-26 15:43:38 -07:00
committed by GitHub
parent 2321c199f0
commit b035c5b0f6

View File

@@ -767,7 +767,9 @@ public class FlutterView extends SurfaceView
// Called by native to notify first Flutter frame rendered.
public void onFirstFrame() {
for (FirstFrameListener listener : mFirstFrameListeners) {
// Allow listeners to remove themselves when they are called.
List<FirstFrameListener> listeners = new ArrayList<>(mFirstFrameListeners);
for (FirstFrameListener listener : listeners) {
listener.onFirstFrame();
}
}