Branch: Tag:

2016-03-03

2016-03-03 11:59:06 by Henrik Grubbström (Grubba) <grubba@grubba.org>

GTK2: Use safe_apply_svalue() instead of apply_svalue() for now.

Throwing Pike-exceptions through the GTK layer is not a good idea...

FIXME: The exceptions probably instead ought to be converted to the
GTK equivalent and back.

Fixes [LysLysKOM 21653937].

203:    Pike_sp[-2]=Pike_sp[0];    /* on stack: function array */    PFTIME("Creating colormap obj"); -  apply_svalue(Pike_sp-2,1); +  safe_apply_svalue(Pike_sp-2, 1, 1);    /* on stack: function cmap */    get_all_args("internal",1,"%o",&pike_cmap);    pike_cmap->refs+=100; /* lets keep this one.. :-) */
241:    /* on stack: function img bpp linepad depth cmap*/    /* 6 5 4 3 2 1 */    PFTIME("Dithering image"); -  apply_svalue(Pike_sp-6,5); +  safe_apply_svalue(Pike_sp-6, 5, 1);    if (TYPEOF(Pike_sp[-1]) != PIKE_T_STRING) {    gdk_image_destroy((void *)i);    Pike_error("Failed to convert image\n");
450:   gint pgtk2_buttonfuncwrapper(GObject *obj, struct signal_data *d, void *foo) {    int res;    push_svalue(&d->args); -  apply_svalue(&d->cb, 1); +  safe_apply_svalue(&d->cb, 1, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;
783:    pgtk2_push_gvalue_rt(&(param_values[i]));    }    push_svalue(&d->args); -  apply_svalue(&d->cb,2+n_params); +  safe_apply_svalue(&d->cb, 2+n_params, 1);    if (return_value && G_VALUE_TYPE(return_value) != 0 )    pgtk2_set_value(return_value,&Pike_sp[-1]);    pop_stack();
1281:    push_pgdk2object(a,pgtk2_tree_iter_program,0);    push_pgdk2object(b,pgtk2_tree_iter_program,0);    push_svalue(&d->args); -  apply_svalue(&d->cb,4); +  safe_apply_svalue(&d->cb, 4, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;
1357:    push_gobject(model);    push_gobjectclass(iter,pgtk2_tree_iter_program);    push_svalue(&d->args); -  apply_svalue(&d->cb,3); +  safe_apply_svalue(&d->cb, 3, 1);    res=Pike_sp[-1].u.integer;    pop_stack();    return res;
1373:    push_gobject(x);    pgtk2_push_gchar( key );    push_gobjectclass(iter,pgtk2_tree_iter_program); -  apply_svalue( &d->cb, 3 ); +  safe_apply_svalue( &d->cb, 3, 1 );    res = Pike_sp[-1].u.integer;    pop_stack();    return res;