Skip to content

Commit

Permalink
Fix iOS crash when multiple platform views are in the scene (flutter#…
Browse files Browse the repository at this point in the history
…13449)

Having 2 or more platform views simultaneously in the layer tree was crashing immediately on iOS with GL backend.

This regressed in flutter#11070 which passed gl_context to a function in a loop using std::move (which meant on the second iteration the caller is no longer the owner of the field).

I added a scenarios_app test, though this test doesn't run on a physical device on CI so it would have only caught the problem when running locally (flutter/flutter#43852).
  • Loading branch information
amirh authored and Dmitry Lyzlov committed Mar 23, 2020
1 parent 508e0ff commit 0f58c84
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
for (int64_t view_id : composition_order_) {
auto contextSwitch = ConstructRendererContextSwitchIfAvailable();

EnsureOverlayInitialized(view_id, std::move(gl_context), gr_context);
EnsureOverlayInitialized(view_id, gl_context, gr_context);
auto frame = overlays_[view_id]->surface->AcquireFrame(frame_size_);
SkCanvas* canvas = frame->SkiaCanvas();
canvas->drawPicture(picture_recorders_[view_id]->finishRecordingAsPicture());
Expand Down

0 comments on commit 0f58c84

Please sign in to comment.