Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f9241f9

Browse files
authored
Initialize members and check for nullptr (#30941)
1 parent f2f455c commit f9241f9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

shell/common/shell_test_external_view_embedder.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ SkCanvas* ShellTestExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
6464
void ShellTestExternalViewEmbedder::SubmitFrame(
6565
GrDirectContext* context,
6666
std::unique_ptr<SurfaceFrame> frame) {
67+
if (!frame) {
68+
return;
69+
}
6770
frame->Submit();
68-
if (frame && frame->SkiaSurface()) {
71+
if (frame->SkiaSurface()) {
6972
last_submitted_frame_size_ = SkISize::Make(frame->SkiaSurface()->width(),
7073
frame->SkiaSurface()->height());
7174
} else {

shell/platform/embedder/embedder_task_runner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class EmbedderTaskRunner final : public fml::TaskRunner {
7575
const size_t embedder_identifier_;
7676
DispatchTable dispatch_table_;
7777
std::mutex tasks_mutex_;
78-
uint64_t last_baton_;
78+
uint64_t last_baton_ = 0;
7979
std::unordered_map<uint64_t, fml::closure> pending_tasks_;
8080
fml::TaskQueueId placeholder_id_;
8181

shell/platform/glfw/text_input_plugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TextInputPlugin : public KeyboardHookHandler {
5353
std::unique_ptr<flutter::MethodChannel<rapidjson::Document>> channel_;
5454

5555
// The active client id.
56-
int client_id_;
56+
int client_id_ = 0;
5757

5858
// The active model. nullptr if not set.
5959
std::unique_ptr<TextInputModel> active_model_;

0 commit comments

Comments
 (0)