Skip to content

Commit

Permalink
oscplot.c: Fix segfault when enabling markers in frequency domain
Browse files Browse the repository at this point in the history
The issue was introduced when the deprecated gtk_signal_connect has been removed (commit 51ce390). It's equivalent is g_signal_connect_swapped and not g_signal_connect_object.

Signed-off-by: Dan Nechita <[email protected]>
  • Loading branch information
dNechita committed Nov 25, 2019
1 parent d66f555 commit 0a26b86
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions oscplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -5656,17 +5656,17 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
if (!full && !(priv->marker_type == MARKER_OFF || priv->marker_type == MARKER_IMAGE)) {
menuitem = gtk_menu_item_new_with_label(ADD_MRK);
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->add_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->add_mrk);
gtk_widget_show(menuitem);
i++;
}

if (!empty && !(priv->marker_type == MARKER_OFF || priv->marker_type == MARKER_IMAGE)) {
menuitem = gtk_menu_item_new_with_label(REMOVE_MRK);
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->remove_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->remove_mrk);
gtk_widget_show(menuitem);
i++;
}
Expand All @@ -5682,8 +5682,8 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_PEAK);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->peak_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->peak_mrk);
gtk_widget_show(menuitem);
i++;

Expand All @@ -5695,17 +5695,17 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_FIXED);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->fix_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->fix_mrk);
gtk_widget_show(menuitem);
i++;

menuitem = gtk_check_menu_item_new_with_label(SINGLE_MRK);
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_ONE_TONE);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->single_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->single_mrk);
gtk_widget_show(menuitem);
i++;

Expand All @@ -5714,8 +5714,8 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_TWO_TONE);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->dual_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->dual_mrk);
gtk_widget_show(menuitem);
i++;
*/
Expand All @@ -5725,8 +5725,8 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_IMAGE);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->image_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->image_mrk);
gtk_widget_show(menuitem);
i++;
}
Expand All @@ -5738,8 +5738,8 @@ static gint marker_button(GtkDatabox *box, GdkEventButton *event, gpointer data)
gtk_menu_attach(GTK_MENU(popupmenu), menuitem, 0, 1, i, i + 1);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
priv->marker_type == MARKER_OFF);
g_signal_connect_object(GTK_OBJECT(menuitem), "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->off_mrk, G_CONNECT_AFTER);
g_signal_connect_swapped(menuitem, "activate",
G_CALLBACK(marker_menu), (gpointer) &priv->off_mrk);
gtk_widget_show(menuitem);
i++;
}
Expand Down

0 comments on commit 0a26b86

Please sign in to comment.