Don't show warnings when removing handlers. (flutter/engine#18633)

These are removed in destructors.
This commit is contained in:
Robert Ancell 2020-06-02 11:32:57 +12:00 committed by GitHub
parent 5a78bd2f4d
commit 486f8e4886
3 changed files with 13 additions and 6 deletions

View File

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

View File

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

View File

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