Fix incorrect parameter used for self object (flutter/engine#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.
This commit is contained in:
Robert Ancell
2020-10-30 14:52:24 +13:00
committed by GitHub
parent 5cadb93fe2
commit 904e5d491e
4 changed files with 9 additions and 5 deletions

View File

@@ -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;

View File

@@ -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<FlutterSource*>(user_data);
source->engine = nullptr;
g_source_destroy(reinterpret_cast<GSource*>(source));

View File

@@ -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;
}

View File

@@ -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;
}