From eea7561ac87471f5121000bcf66c149ce897b84d Mon Sep 17 00:00:00 2001 From: David Odin Date: Sat, 30 Oct 2004 21:31:18 +0000 Subject: [PATCH] plug-ins/gfig/gfig-dobject.c fixed some annoying popup messages at the * plug-ins/gfig/gfig-dobject.c * plug-ins/gfig/gfig-style.c: fixed some annoying popup messages at the price of a smallish mem-leak that I will fix later. --- ChangeLog | 6 ++++++ plug-ins/gfig/gfig-dobject.c | 23 ++++++++++++----------- plug-ins/gfig/gfig-style.c | 8 ++++---- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98a35d9efb..a82cfe3302 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-30 DindinX + + * plug-ins/gfig/gfig-dobject.c + * plug-ins/gfig/gfig-style.c: fixed some annoying popup messages at + the price of a smallish mem-leak that I will fix later. + 2004-10-30 Sven Neumann * app/composite/gimp-composite-generic.c diff --git a/plug-ins/gfig/gfig-dobject.c b/plug-ins/gfig/gfig-dobject.c index 7f7949fe62..e69d8111fa 100644 --- a/plug-ins/gfig/gfig-dobject.c +++ b/plug-ins/gfig/gfig-dobject.c @@ -51,19 +51,20 @@ #include "libgimp/stdplugins-intl.h" -static Dobject *operation_obj; +static Dobject *operation_obj = NULL; static GdkPoint *move_all_pnt; /* Point moving all from */ -static void draw_one_obj (Dobject *obj); -static void do_move_obj (Dobject *obj, - GdkPoint *to_pnt); -static void do_move_all_obj (GdkPoint *to_pnt); -static void do_move_obj_pnt (Dobject *obj, - GdkPoint *to_pnt); -static void remove_obj_from_list (GFigObj *obj, - Dobject *del_obj); -static gint scan_obj_points (DobjPoints *opnt, - GdkPoint *pnt); + +static void draw_one_obj (Dobject *obj); +static void do_move_obj (Dobject *obj, + GdkPoint *to_pnt); +static void do_move_all_obj (GdkPoint *to_pnt); +static void do_move_obj_pnt (Dobject *obj, + GdkPoint *to_pnt); +static void remove_obj_from_list (GFigObj *obj, + Dobject *del_obj); +static gint scan_obj_points (DobjPoints *opnt, + GdkPoint *pnt); void d_save_object (Dobject *obj, diff --git a/plug-ins/gfig/gfig-style.c b/plug-ins/gfig/gfig-style.c index 3cda7c304d..989dbf1360 100644 --- a/plug-ins/gfig/gfig-style.c +++ b/plug-ins/gfig/gfig-style.c @@ -210,7 +210,7 @@ gfig_load_style (Style *style, if (!strcmp (load_buf2, "") || feof (fp)) break; - style_text[nitems] = (gchar *) g_malloc (MAX_LOAD_LINE); + style_text[nitems] = g_new (gchar, MAX_LOAD_LINE); strcpy (style_text[nitems], load_buf2); nitems++; } @@ -452,11 +452,11 @@ gfig_brush_changed_callback (const gchar *brush_name, if (!brush_name) g_message ("Error: setting brush name to NULL in color selector callback."); - gfig_context->current_style->brush_name = (gchar *) brush_name; - gfig_context->default_style.brush_name = (gchar *) brush_name; + gfig_context->current_style->brush_name = g_strdup (brush_name); /* DDX */ + gfig_context->default_style.brush_name = g_strdup (brush_name); /* DDX */ /* this will soon be unneeded */ - gfig_context->bdesc.name = (gchar *) brush_name; + gfig_context->bdesc.name = g_strdup (brush_name); /* DDX */ gfig_context->bdesc.width = width; gfig_context->bdesc.height = height; gimp_context_set_brush (brush_name);