diff --git a/shell/platform/linux/fl_text_input_plugin.cc b/shell/platform/linux/fl_text_input_plugin.cc index b89e184238c9dbaa27bddb2ae0d2caeab1da949b..492f0ae6811fbf4be5173b18753c122456e7afb8 100644 --- a/shell/platform/linux/fl_text_input_plugin.cc +++ b/shell/platform/linux/fl_text_input_plugin.cc @@ -423,11 +423,6 @@ static void method_call_cb(FlMethodChannel* channel, } } -static void view_weak_notify_cb(gpointer user_data, GObject* object) { - FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(object); - self->view = nullptr; -} - static void fl_text_input_plugin_dispose(GObject* object) { FlTextInputPlugin* self = FL_TEXT_INPUT_PLUGIN(object); @@ -438,6 +433,7 @@ static void fl_text_input_plugin_dispose(GObject* object) { delete self->text_model; self->text_model = nullptr; } + self->view = nullptr; G_OBJECT_CLASS(fl_text_input_plugin_parent_class)->dispose(object); } @@ -483,7 +479,6 @@ FlTextInputPlugin* fl_text_input_plugin_new(FlBinaryMessenger* messenger, fl_method_channel_set_method_call_handler(self->channel, method_call_cb, self, nullptr); self->view = view; - g_object_weak_ref(G_OBJECT(view), view_weak_notify_cb, self); return self; }