[gimp] app: use GSlice for GimpBezierDesc
- From: Sven Neumann <neo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use GSlice for GimpBezierDesc
- Date: Thu, 16 Sep 2010 22:15:19 +0000 (UTC)
commit 31fb4c955966074b5645b0daeb47cb13dd791d82
Author: Sven Neumann <sven gimp org>
Date: Thu Sep 16 23:27:25 2010 +0200
app: use GSlice for GimpBezierDesc
app/vectors/gimpbezierstroke.c | 2 +-
app/vectors/gimpvectors.c | 11 +++++------
2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/app/vectors/gimpbezierstroke.c b/app/vectors/gimpbezierstroke.c
index 9cb1723..5ba0e63 100644
--- a/app/vectors/gimpbezierstroke.c
+++ b/app/vectors/gimpbezierstroke.c
@@ -1535,7 +1535,7 @@ gimp_bezier_stroke_make_bezier (const GimpStroke *stroke)
g_printerr ("miscalculated path cmd length! (%d vs. %d)\n",
cmd_array->len, num_cmds);
- bezdesc = g_new (GimpBezierDesc, 1);
+ bezdesc = g_slice_new (GimpBezierDesc);
bezdesc->status = CAIRO_STATUS_SUCCESS;
bezdesc->data = (cairo_path_data_t *) cmd_array->data;
bezdesc->num_data = cmd_array->len;
diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c
index e788cba..735bd96 100644
--- a/app/vectors/gimpvectors.c
+++ b/app/vectors/gimpvectors.c
@@ -168,7 +168,7 @@ gimp_vectors_class_init (GimpVectorsClass *klass)
gimp_vectors_signals[FREEZE] =
g_signal_new ("freeze",
G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
+ G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpVectorsClass, freeze),
NULL, NULL,
gimp_marshal_VOID__VOID,
@@ -258,7 +258,7 @@ gimp_vectors_finalize (GObject *object)
if (vectors->bezier_desc)
{
g_free (vectors->bezier_desc->data);
- g_free (vectors->bezier_desc);
+ g_slice_free (GimpBezierDesc, vectors->bezier_desc);
vectors->bezier_desc = NULL;
}
@@ -608,11 +608,10 @@ static void
gimp_vectors_real_freeze (GimpVectors *vectors)
{
/* release cached bezier representation */
-
if (vectors->bezier_desc)
{
g_free (vectors->bezier_desc->data);
- g_free (vectors->bezier_desc);
+ g_slice_free (GimpBezierDesc, vectors->bezier_desc);
vectors->bezier_desc = NULL;
}
}
@@ -1143,13 +1142,13 @@ gimp_vectors_real_make_bezier (const GimpVectors *vectors)
cmd_array = g_array_append_vals (cmd_array, bezdesc->data,
bezdesc->num_data);
g_free (bezdesc->data);
- g_free (bezdesc);
+ g_slice_free (GimpBezierDesc, bezdesc);
}
}
if (cmd_array->len > 0)
{
- ret_bezdesc = g_new (GimpBezierDesc, 1);
+ ret_bezdesc = g_slice_new (GimpBezierDesc);
ret_bezdesc->status = CAIRO_STATUS_SUCCESS;
ret_bezdesc->num_data = cmd_array->len;
ret_bezdesc->data = (cairo_path_data_t *) cmd_array->data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]