Add gtk_border_new to avoid memory allocator confusions when using

2007-12-27  Xan Lopez  <xan@gnome.org>

	* gtk/gtk.symbols:
	* gtk/gtkstyle.c (gtk_border_new, gtk_border_copy):

	Add gtk_border_new to avoid memory allocator confusions when using
	GtkBorders. Also, make gtk_border_copy use g_slice_dup. (#454042)

svn path=/trunk/; revision=19248
This commit is contained in:
Xan Lopez 2007-12-27 14:04:37 +00:00 committed by Xan Lopez
parent 82568d02e0
commit b28fea94a0
6 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2007-12-27 Xan Lopez <xan@gnome.org>
* gtk/gtk.symbols:
* gtk/gtkstyle.c (gtk_border_new, gtk_border_copy):
Add gtk_border_new to avoid memory allocator confusions when using
GtkBorders. Also, make gtk_border_copy use g_slice_dup. (#454042)
2007-12-27 Christian Persch <chpe@gnome.org>
* gdk/x11/gdkscreen-x11.c: (init_randr12): Fir the patch from

View File

@ -1,3 +1,7 @@
2007-12-27 Xan Lopez <xan@gnome.org>
* gtk/gtk-sections.txt: Add gtk_border_new
2007-12-19 19:54:11 Tim Janik <timj@imendio.com>
* libgail-util/Makefile.am: include Makefile.decl to unbreak test rules.

View File

@ -5646,6 +5646,7 @@ gtk_draw_insertion_cursor
<SUBSECTION>
GtkBorder
gtk_border_new
gtk_border_copy
gtk_border_free

View File

@ -1172,6 +1172,7 @@ gtk_paint_shadow_gap
gtk_paint_slider
gtk_paint_tab
gtk_paint_vline
gtk_border_new G_GNUC_MALLOC
gtk_border_copy
gtk_border_free
gtk_border_get_type G_GNUC_CONST

View File

@ -6398,6 +6398,21 @@ gtk_paint_resize_grip (GtkStyle *style,
edge, x, y, width, height);
}
/**
* gtk_border_new:
*
* Allocates a new #GtkBorder structure and initializes its elements to zero.
*
* Returns: a new empty #GtkBorder. The newly allocated #GtkBorder should be freed
* with gtk_border_free()
* Since: 2.16
**/
GtkBorder *
gtk_border_new (void)
{
return g_slice_new0 (GtkBorder);
}
/**
* gtk_border_copy:
* @border_: a #GtkBorder.
@ -6408,15 +6423,9 @@ gtk_paint_resize_grip (GtkStyle *style,
GtkBorder *
gtk_border_copy (const GtkBorder *border)
{
GtkBorder *ret;
g_return_val_if_fail (border != NULL, NULL);
ret = g_slice_new (GtkBorder);
*ret = *border;
return ret;
return g_slice_dup (GtkBorder, border);
}
/**

View File

@ -856,6 +856,7 @@ void gtk_paint_resize_grip (GtkStyle *style,
GType gtk_border_get_type (void) G_GNUC_CONST;
GtkBorder *gtk_border_new (void) G_GNUC_MALLOC;
GtkBorder *gtk_border_copy (const GtkBorder *border_);
void gtk_border_free (GtkBorder *border_);