Commit 5d0a6dfe authored by jaycox's avatar jaycox
Browse files

----------------------------------------------------------------------


 ----------------------------------------------------------------------
 Modified Files:
 	ChangeLog app/brush_select.c app/gimpbrushgenerated.c
 	app/gimpbrushlist.c
      fixed brush ref counting.
 ----------------------------------------------------------------------
parent f4b772a9
Mon Jul 13 03:00:46 PDT 1998 Jay Cox <jaycox@earthlink.net>
* brush_select.c gimpbrushlist.c: fixed brush ref counting
Mon Jul 13 07:42:36 BST 1998 Adam D. Moss <adam@gimp.org>
* app/convert.c: July 6th's patch from Yasuhiro SHIRASAKI for
......
......@@ -402,7 +402,8 @@ connect_signals_to_brush(GimpBrushP brush, BrushSelectP bsp)
static void
disconnect_signals_from_brush(GimpBrushP brush, BrushSelectP bsp)
{
gtk_signal_disconnect_by_data(GTK_OBJECT(brush), bsp);
if (!GTK_OBJECT_DESTROYED(brush))
gtk_signal_disconnect_by_data(GTK_OBJECT(brush), bsp);
}
static void
......
......@@ -124,10 +124,9 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
{
temp_buf_free(gbrush->mask);
}
#define D_TO_R M_PI/180
/* compute the range of the brush, should do a better job than this */
s = sin(brush->angle*M_PI/180);
c = cos(brush->angle*M_PI/180);
s = sin(brush->angle*M_PI/180.0);
c = cos(brush->angle*M_PI/180.0);
tx = MAXIMUM(fabs(c*ceil(brush->radius) - s*ceil(brush->radius)
/brush->aspect_ratio),
fabs(c*ceil(brush->radius) + s*ceil(brush->radius)
......
......@@ -124,10 +124,9 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
{
temp_buf_free(gbrush->mask);
}
#define D_TO_R M_PI/180
/* compute the range of the brush, should do a better job than this */
s = sin(brush->angle*M_PI/180);
c = cos(brush->angle*M_PI/180);
s = sin(brush->angle*M_PI/180.0);
c = cos(brush->angle*M_PI/180.0);
tx = MAXIMUM(fabs(c*ceil(brush->radius) - s*ceil(brush->radius)
/brush->aspect_ratio),
fabs(c*ceil(brush->radius) + s*ceil(brush->radius)
......
......@@ -124,10 +124,9 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
{
temp_buf_free(gbrush->mask);
}
#define D_TO_R M_PI/180
/* compute the range of the brush, should do a better job than this */
s = sin(brush->angle*M_PI/180);
c = cos(brush->angle*M_PI/180);
s = sin(brush->angle*M_PI/180.0);
c = cos(brush->angle*M_PI/180.0);
tx = MAXIMUM(fabs(c*ceil(brush->radius) - s*ceil(brush->radius)
/brush->aspect_ratio),
fabs(c*ceil(brush->radius) + s*ceil(brush->radius)
......
......@@ -124,10 +124,9 @@ gimp_brush_generated_generate(GimpBrushGenerated *brush)
{
temp_buf_free(gbrush->mask);
}
#define D_TO_R M_PI/180
/* compute the range of the brush, should do a better job than this */
s = sin(brush->angle*M_PI/180);
c = cos(brush->angle*M_PI/180);
s = sin(brush->angle*M_PI/180.0);
c = cos(brush->angle*M_PI/180.0);
tx = MAXIMUM(fabs(c*ceil(brush->radius) - s*ceil(brush->radius)
/brush->aspect_ratio),
fabs(c*ceil(brush->radius) + s*ceil(brush->radius)
......
......@@ -60,9 +60,7 @@ static int have_default_brush = 0;
/* static function prototypes */
static void create_default_brush (void);
static void brushes_free_one (gpointer, gpointer);
static gint brush_compare_func (gconstpointer,
gconstpointer);
static gint brush_compare_func (gconstpointer, gconstpointer);
static void gimp_brush_list_recalc_indexes(GimpBrushList *brush_list);
static void gimp_brush_list_uniquefy_names(GimpBrushList *brush_list);
......@@ -192,13 +190,6 @@ brushes_init (int no_data)
gimp_brush_list_uniquefy_names(brush_list);
}
static void
brushes_free_one (gpointer data, gpointer dummy)
{
gimp_object_unref (GIMP_OBJECT(data));
}
static gint
brush_compare_func (gconstpointer first, gconstpointer second)
{
......@@ -211,8 +202,7 @@ void
brushes_free ()
{
if (brush_list) {
/* gimp_list_foreach (GIMP_LIST(brush_list), brushes_free_one, NULL);*/
gimp_object_destroy(GIMP_OBJECT(brush_list));
gimp_object_unref (GIMP_OBJECT(brush_list));
}
have_default_brush = 0;
......@@ -303,6 +293,7 @@ void
gimp_brush_list_add (GimpBrushList *brush_list, GimpBrush * brush)
{
gimp_list_add(GIMP_LIST(brush_list), brush);
gtk_object_sink(GTK_OBJECT(brush));
gimp_brush_list_recalc_indexes(brush_list);
}
......
......@@ -402,7 +402,8 @@ connect_signals_to_brush(GimpBrushP brush, BrushSelectP bsp)
static void
disconnect_signals_from_brush(GimpBrushP brush, BrushSelectP bsp)
{
gtk_signal_disconnect_by_data(GTK_OBJECT(brush), bsp);
if (!GTK_OBJECT_DESTROYED(brush))
gtk_signal_disconnect_by_data(GTK_OBJECT(brush), bsp);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment