From b6e9a7df15a7b5cc854d431fade8a1e002013287 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 10 Jan 2020 15:45:20 -0300 Subject: [PATCH] Fixing trace tab warning. --- server/src/plugin/plugin.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/server/src/plugin/plugin.c b/server/src/plugin/plugin.c index 5c3e972..8a52016 100644 --- a/server/src/plugin/plugin.c +++ b/server/src/plugin/plugin.c @@ -40,10 +40,11 @@ int pw3270_plugin_page_added(GtkWidget *terminal) { - // Creates IPC, associate it with the terminal window. + if(!GTK_IS_V3270(terminal)) + return EINVAL; - g_return_val_if_fail(GTK_IS_V3270(terminal),EINVAL); + // Creates IPC, associate it with the terminal window. // Build session name. g_autofree gchar * session_name = g_strdup(v3270_get_session_name(terminal)); { @@ -108,13 +109,13 @@ int pw3270_plugin_page_removed(GtkWidget *terminal) { - if(GTK_IS_V3270(terminal)) { - debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info")); - g_object_set_data(G_OBJECT(terminal), "ipc-object-info", NULL); - return 0; - } + if(!GTK_IS_V3270(terminal)) + return EINVAL; + + debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info")); + g_object_set_data(G_OBJECT(terminal), "ipc-object-info", NULL); + return 0; - return -1; } int pw3270_plugin_start(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) { -- libgit2 0.21.2