mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Don't show warnings when removing handlers. (flutter/engine#18633)
These are removed in destructors.
This commit is contained in:
parent
5a78bd2f4d
commit
486f8e4886
@ -182,8 +182,10 @@ G_MODULE_EXPORT void fl_basic_message_channel_set_message_handler(
|
||||
|
||||
// Don't set handler if channel closed
|
||||
if (self->channel_closed) {
|
||||
g_warning(
|
||||
"Attempted to set message handler on closed FlBasicMessageChannel");
|
||||
if (handler != nullptr) {
|
||||
g_warning(
|
||||
"Attempted to set message handler on a closed FlBasicMessageChannel");
|
||||
}
|
||||
if (destroy_notify != nullptr)
|
||||
destroy_notify(user_data);
|
||||
return;
|
||||
|
||||
@ -175,9 +175,11 @@ G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel(
|
||||
|
||||
// Don't set handlers if engine already gone
|
||||
if (self->engine == nullptr) {
|
||||
g_warning(
|
||||
"Attempted to set message handler on closed FlBinaryMessenger without "
|
||||
"engine");
|
||||
if (handler != nullptr) {
|
||||
g_warning(
|
||||
"Attempted to set message handler on an FlBinaryMessenger without an "
|
||||
"engine");
|
||||
}
|
||||
if (destroy_notify != nullptr)
|
||||
destroy_notify(user_data);
|
||||
return;
|
||||
|
||||
@ -140,7 +140,10 @@ G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(
|
||||
|
||||
// Don't set handler if channel closed
|
||||
if (self->channel_closed) {
|
||||
g_warning("Attempted to set method call handler on closed FlMethodChannel");
|
||||
if (handler != nullptr) {
|
||||
g_warning(
|
||||
"Attempted to set method call handler on a closed FlMethodChannel");
|
||||
}
|
||||
if (destroy_notify != nullptr)
|
||||
destroy_notify(user_data);
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user