Fix potential crash of frame management while merging threads for platform views. (flutter/engine#27695)

This commit is contained in:
wqyfavor
2021-07-28 00:09:02 +08:00
committed by GitHub
parent f0948740cd
commit 3ad5050003
2 changed files with 2 additions and 2 deletions

View File

@@ -225,8 +225,8 @@ PostPrerollResult AndroidExternalViewEmbedder::PostPrerollAction(
//
// Eventually, the frame is submitted once this method returns `kSuccess`.
// At that point, the raster tasks are handled on the platform thread.
raster_thread_merger->MergeWithLease(kDefaultMergedLeaseDuration);
CancelFrame();
raster_thread_merger->MergeWithLease(kDefaultMergedLeaseDuration);
return PostPrerollResult::kSkipAndRetryFrame;
}
raster_thread_merger->ExtendLeaseTo(kDefaultMergedLeaseDuration);

View File

@@ -276,8 +276,8 @@ PostPrerollResult FlutterPlatformViewsController::PostPrerollAction(
//
// Eventually, the frame is submitted once this method returns `kSuccess`.
// At that point, the raster tasks are handled on the platform thread.
raster_thread_merger->MergeWithLease(kDefaultMergedLeaseDuration);
CancelFrame();
raster_thread_merger->MergeWithLease(kDefaultMergedLeaseDuration);
return PostPrerollResult::kSkipAndRetryFrame;
}
// If the post preroll action is successful, we will display platform views in the current frame.