未验证 提交 24e1e8c8 编写于 作者: R Robert Ancell 提交者: GitHub

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

These are removed in destructors.
上级 42b40b43
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册