[PULL REQUEST] A couple of small mods post the delmulti rework

Dirk Hohndel dirk at hohndel.org
Sat Sep 29 17:28:22 PDT 2012


On Sep 29, 2012, at 5:02 PM, Lubomir I. Ivanov wrote:

> On 30 September 2012 02:45, Dirk Hohndel <dirk at hohndel.org> wrote:
>> Dive-> equipment
>> 
>> /D
> 
> yeah...this makes no sense to me at all as GtkButton inherits from GtkWidget.
> 
> in equipment.c:
> 
> i pass "button" as a GTK_WIDGET to:
> edit_weightsystem_dialog(GTK_WIDGET(button)...
> 
> receive it as "w"
> edit_weightsystem_dialog(GtkWidget *w,...
> 
> then get the widget parent as:
> parent = gtk_widget_get_ancestor(w, GTK_TYPE_DIALOG);
> 
> so what the assert is telling me is that a "GtkButton" is not a
> "GtkWidget", which makes no sense.
> 
> the patch works on 2 OS with 3 different versions of GTK.
> so this solves a crash on Ubuntu, but now opens an OSX / GTK
> issue...fun times. :-)

You are not testing the same sequence as I am. Here is why:

in row_activated_cb:
	edit_cb(NULL, w_idx);

then in static void edit_cb(GtkButton *button, int w_idx)

	if (!edit_cylinder_dialog(GTK_WIDGET(button), index, &cyl, w_idx))

i.e. the stack trace shows

#4  0x000000010001078b in edit_cylinder_dialog (w=0x0, index=0, cyl=0x7fff5fbfdea0, w_idx=1) at equipment.c:1067

and then calling 

1067		parent = gtk_widget_get_ancestor(w, GTK_TYPE_DIALOG);

has every right to blow up, doesn't it?

This has nothing to do with gtk incompatibilities.

/D


More information about the subsurface mailing list