Branch: Tag:

2008-01-23

2008-01-23 04:27:46 by Per Hedbor <ph@opera.com>

Fixed a memory leak. Do utf8-conversion for string gvalues.

Rev: src/post_modules/GTK2/source/support.c:1.18

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: support.c,v 1.17 2007/11/28 13:17:24 per Exp $ + || $Id: support.c,v 1.18 2008/01/23 04:27:46 per Exp $   */      #include <version.h>
595:   }      static int pgtk2_push_gparamspec_param(const GValue *a) { +  push_int(0); +  return PUSHED_VALUE;   }      static struct push_callback {
723:    break;    }    } -  +  {    char *a="";    if (!s) {    a="Unknown child of ";
733:    }    Pike_error("No push callback for type %d (%s%s)\n",t,a,s);    } +  }    return;   }   
753:    guint n_params,    const GValue *param_values,    GValue *return_value) { -  int i; +  unsigned int i;       if (!last_used_callback)    build_push_callbacks();
1213:    g_value_set_double(gv,(gdouble)pgtk2_get_float(sv));    break;    case G_TYPE_STRING: -  if (sv->type==PIKE_T_STRING) { -  g_value_set_string(gv,CGSTR0(sv->u.string)); -  add_ref(sv->u.string); +  if (sv->type==PIKE_T_STRING) +  { +  push_svalue( sv ); +  f_string_to_utf8(1); +  g_value_set_string(gv,CGSTR0(Pike_sp[-1].u.string)); +  pop_stack();    } else    g_value_set_string(gv,"");    break;