Initialize members and check for nullptr (flutter/engine#30941)

This commit is contained in:
m-bialek
2022-02-17 22:04:02 +01:00
committed by GitHub
parent 07714e7781
commit 266fc0e6d4
3 changed files with 6 additions and 3 deletions

View File

@@ -64,8 +64,11 @@ SkCanvas* ShellTestExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
void ShellTestExternalViewEmbedder::SubmitFrame(
GrDirectContext* context,
std::unique_ptr<SurfaceFrame> frame) {
if (!frame) {
return;
}
frame->Submit();
if (frame && frame->SkiaSurface()) {
if (frame->SkiaSurface()) {
last_submitted_frame_size_ = SkISize::Make(frame->SkiaSurface()->width(),
frame->SkiaSurface()->height());
} else {

View File

@@ -75,7 +75,7 @@ class EmbedderTaskRunner final : public fml::TaskRunner {
const size_t embedder_identifier_;
DispatchTable dispatch_table_;
std::mutex tasks_mutex_;
uint64_t last_baton_;
uint64_t last_baton_ = 0;
std::unordered_map<uint64_t, fml::closure> pending_tasks_;
fml::TaskQueueId placeholder_id_;

View File

@@ -53,7 +53,7 @@ class TextInputPlugin : public KeyboardHookHandler {
std::unique_ptr<flutter::MethodChannel<rapidjson::Document>> channel_;
// The active client id.
int client_id_;
int client_id_ = 0;
// The active model. nullptr if not set.
std::unique_ptr<TextInputModel> active_model_;