From 382f5ccba5ee02c7289b65fe7e860c3f20b949f6 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 30 Oct 2020 14:52:24 +1300 Subject: [PATCH] Fix incorrect parameter used for self object (#22135) Fix incorrect parameter used for self object Rename the GWeakNotify function parameters. This matches the prototype and makes it harder to accidentally use the object parameter the wrong way. --- shell/platform/linux/fl_binary_messenger.cc | 3 ++- shell/platform/linux/fl_engine.cc | 3 ++- shell/platform/linux/fl_mouse_cursor_plugin.cc | 5 +++-- shell/platform/linux/fl_plugin_registrar.cc | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/shell/platform/linux/fl_binary_messenger.cc b/shell/platform/linux/fl_binary_messenger.cc index e817fd362..770ec76ed 100644 --- a/shell/platform/linux/fl_binary_messenger.cc +++ b/shell/platform/linux/fl_binary_messenger.cc @@ -100,7 +100,8 @@ static void platform_message_handler_free(gpointer data) { g_free(self); } -static void engine_weak_notify_cb(gpointer user_data, GObject* object) { +static void engine_weak_notify_cb(gpointer user_data, + GObject* where_the_object_was) { FlBinaryMessenger* self = FL_BINARY_MESSENGER(user_data); self->engine = nullptr; diff --git a/shell/platform/linux/fl_engine.cc b/shell/platform/linux/fl_engine.cc index 6a53f9144..40428edf4 100644 --- a/shell/platform/linux/fl_engine.cc +++ b/shell/platform/linux/fl_engine.cc @@ -152,7 +152,8 @@ static gboolean flutter_source_dispatch(GSource* source, } // Called when the engine is disposed. -static void engine_weak_notify_cb(gpointer user_data, GObject* object) { +static void engine_weak_notify_cb(gpointer user_data, + GObject* where_the_object_was) { FlutterSource* source = reinterpret_cast(user_data); source->engine = nullptr; g_source_destroy(reinterpret_cast(source)); diff --git a/shell/platform/linux/fl_mouse_cursor_plugin.cc b/shell/platform/linux/fl_mouse_cursor_plugin.cc index f00ea52d9..20154101d 100644 --- a/shell/platform/linux/fl_mouse_cursor_plugin.cc +++ b/shell/platform/linux/fl_mouse_cursor_plugin.cc @@ -140,8 +140,9 @@ static void method_call_cb(FlMethodChannel* channel, } } -static void view_weak_notify_cb(gpointer user_data, GObject* object) { - FlMouseCursorPlugin* self = FL_MOUSE_CURSOR_PLUGIN(object); +static void view_weak_notify_cb(gpointer user_data, + GObject* where_the_object_was) { + FlMouseCursorPlugin* self = FL_MOUSE_CURSOR_PLUGIN(user_data); self->view = nullptr; } diff --git a/shell/platform/linux/fl_plugin_registrar.cc b/shell/platform/linux/fl_plugin_registrar.cc index 9ca72258b..fd099d59b 100644 --- a/shell/platform/linux/fl_plugin_registrar.cc +++ b/shell/platform/linux/fl_plugin_registrar.cc @@ -22,7 +22,8 @@ G_MODULE_EXPORT GType fl_plugin_registrar_get_type(); G_DEFINE_TYPE(FlPluginRegistrar, fl_plugin_registrar, G_TYPE_OBJECT) -static void view_weak_notify_cb(gpointer user_data, GObject* object) { +static void view_weak_notify_cb(gpointer user_data, + GObject* where_the_object_was) { FlPluginRegistrar* self = FL_PLUGIN_REGISTRAR(user_data); self->view = nullptr; } -- GitLab