]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fix crash when editing weight system info
authorDirk Hohndel <dirk@hohndel.org>
Sat, 18 Aug 2012 13:24:49 +0000 (06:24 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Sat, 18 Aug 2012 13:24:49 +0000 (06:24 -0700)
I missed one instance where a callback function needed to be passed the widget
index w_idx in the signal_connect function. It got passed a pointer to the
model instead which of course blew up when trying to dereference the array with
that "index".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
equipment.c

index 71639c9d14b3c0cc7bb4fe1c05183ccbbd62852d..d10310c1664fcb81a093d4f917db0021f1fa3653 100644 (file)
@@ -1397,7 +1397,7 @@ GtkWidget *weightsystem_list_widget(int w_idx)
 
        tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
        gtk_widget_set_can_focus(tree_view, FALSE);
-       g_signal_connect(tree_view, "row-activated", G_CALLBACK(ws_row_activated_cb), model);
+       g_signal_connect(tree_view, "row-activated", G_CALLBACK(ws_row_activated_cb), GINT_TO_POINTER(w_idx));
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
        gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);