plugged more memleaks

--Sven
This commit is contained in:
Sven Neumann 1999-11-06 18:19:41 +00:00
parent c05b97ec0b
commit a265c91c65
16 changed files with 85 additions and 36 deletions

View File

@ -1,3 +1,12 @@
Sat Nov 6 19:16:57 *ET 1999 Sven Neumann <sven@gimp.org>
* app/about_dialog.c
* app/gimpobject.c
* app/gimprc.c
* app/layer.c
* app/preferences_dialog.c
* libgimp/gimpfileselection.c: plugged more mem-leaks
Sat Nov 6 15:28:11 MET 1999 Sven Neumann <sven@gimp.org>
* app/gdisplay.h: Reverted my latest change. It disturbed image

View File

@ -229,11 +229,13 @@ about_dialog_create (gint timeout)
gdk_font_unref (style->font);
style->font = gdk_font_load ("-Adobe-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*");
gtk_widget_push_style (style);
gtk_style_unref (style);
label_text = g_strdup_printf("%s%s%s", _("Version "), GIMP_VERSION,
_(" brought to you by"));
label = gtk_label_new (label_text);
g_free(label_text); label_text=NULL;
g_free(label_text);
label_text=NULL;
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);

View File

@ -381,6 +381,7 @@ layer_copy (Layer *layer,
}
/* copy the parasites */
gtk_object_unref (GTK_OBJECT (GIMP_DRAWABLE (new_layer)->parasites));
GIMP_DRAWABLE (new_layer)->parasites
= parasite_list_copy (GIMP_DRAWABLE (layer)->parasites);

View File

@ -10,9 +10,10 @@ gimp_object_class_init (GimpObjectClass *gobjectclass)
{
}
GtkType gimp_object_get_type (void)
GtkType
gimp_object_get_type (void)
{
static GtkType type;
static GtkType type = 0;
GIMP_TYPE_INIT(type,
GimpObject,
GimpObjectClass,

View File

@ -229,11 +229,13 @@ about_dialog_create (gint timeout)
gdk_font_unref (style->font);
style->font = gdk_font_load ("-Adobe-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*");
gtk_widget_push_style (style);
gtk_style_unref (style);
label_text = g_strdup_printf("%s%s%s", _("Version "), GIMP_VERSION,
_(" brought to you by"));
label = gtk_label_new (label_text);
g_free(label_text); label_text=NULL;
g_free(label_text);
label_text=NULL;
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);

View File

@ -822,9 +822,12 @@ file_prefs_filename_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *filename;
val = data;
file_prefs_strset (val, gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget)));
filename = gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget));
file_prefs_strset (val, filename);
g_free (filename);
}
static void
@ -832,9 +835,12 @@ file_prefs_path_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *path;
val = data;
file_prefs_strset (val, gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget)));
path = gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget));
file_prefs_strset (val, path);
g_free (path);
}
static void
@ -1140,7 +1146,6 @@ file_pref_cmd_callback (GtkWidget *widget,
old_monitor_yres = monitor_yres;
old_using_xserver_resolution = using_xserver_resolution;
old_num_processors = num_processors;
old_image_title_format = file_prefs_strdup (image_title_format);
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
@ -1148,6 +1153,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_trust_dirty_flag = trust_dirty_flag;
old_use_help = use_help;
file_prefs_strset (&old_image_title_format, image_title_format);
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
file_prefs_strset (&old_plug_in_path, edit_plug_in_path);

View File

@ -381,6 +381,7 @@ layer_copy (Layer *layer,
}
/* copy the parasites */
gtk_object_unref (GTK_OBJECT (GIMP_DRAWABLE (new_layer)->parasites));
GIMP_DRAWABLE (new_layer)->parasites
= parasite_list_copy (GIMP_DRAWABLE (layer)->parasites);

View File

@ -10,9 +10,10 @@ gimp_object_class_init (GimpObjectClass *gobjectclass)
{
}
GtkType gimp_object_get_type (void)
GtkType
gimp_object_get_type (void)
{
static GtkType type;
static GtkType type = 0;
GIMP_TYPE_INIT(type,
GimpObject,
GimpObjectClass,

View File

@ -485,6 +485,7 @@ save_gimprc_strings (gchar *token,
gchar *prev_line;
gchar *error_msg;
gboolean found = FALSE;
gchar *personal_gimprc;
UnknownToken *ut; /* variables to modify unknown_tokens */
UnknownToken *tmp;
@ -496,13 +497,16 @@ save_gimprc_strings (gchar *token,
/* get the name of the backup file, and the file pointers. 'name'
is reused in another context later, disregard it here */
error_msg = open_backup_file (gimp_personal_rc_file ("gimprc"),
personal_gimprc = gimp_personal_rc_file ("gimprc");
error_msg = open_backup_file (personal_gimprc,
gimp_system_rc_file (),
&name, &fp_new, &fp_old);
g_free (personal_gimprc);
if (error_msg != NULL)
{
g_message (error_msg);
g_free (error_msg);
return;
}
@ -621,18 +625,22 @@ save_gimprc (GList **updated_options,
char *cur_line;
char *prev_line;
char *str;
char *error_msg;
gchar *error_msg;
gchar *personal_gimprc;
g_assert(updated_options != NULL);
g_assert(conflicting_options != NULL);
error_msg = open_backup_file (gimp_personal_rc_file ("gimprc"),
personal_gimprc = gimp_personal_rc_file ("gimprc");
error_msg = open_backup_file (personal_gimprc,
gimp_system_rc_file (),
&name, &fp_new, &fp_old);
g_free (personal_gimprc);
if (error_msg != NULL)
{
g_message (error_msg);
g_free (error_msg);
return;
}

View File

@ -229,11 +229,13 @@ about_dialog_create (gint timeout)
gdk_font_unref (style->font);
style->font = gdk_font_load ("-Adobe-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*");
gtk_widget_push_style (style);
gtk_style_unref (style);
label_text = g_strdup_printf("%s%s%s", _("Version "), GIMP_VERSION,
_(" brought to you by"));
label = gtk_label_new (label_text);
g_free(label_text); label_text=NULL;
g_free(label_text);
label_text=NULL;
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);

View File

@ -822,9 +822,12 @@ file_prefs_filename_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *filename;
val = data;
file_prefs_strset (val, gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget)));
filename = gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget));
file_prefs_strset (val, filename);
g_free (filename);
}
static void
@ -832,9 +835,12 @@ file_prefs_path_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *path;
val = data;
file_prefs_strset (val, gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget)));
path = gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget));
file_prefs_strset (val, path);
g_free (path);
}
static void
@ -1140,7 +1146,6 @@ file_pref_cmd_callback (GtkWidget *widget,
old_monitor_yres = monitor_yres;
old_using_xserver_resolution = using_xserver_resolution;
old_num_processors = num_processors;
old_image_title_format = file_prefs_strdup (image_title_format);
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
@ -1148,6 +1153,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_trust_dirty_flag = trust_dirty_flag;
old_use_help = use_help;
file_prefs_strset (&old_image_title_format, image_title_format);
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
file_prefs_strset (&old_plug_in_path, edit_plug_in_path);

View File

@ -381,6 +381,7 @@ layer_copy (Layer *layer,
}
/* copy the parasites */
gtk_object_unref (GTK_OBJECT (GIMP_DRAWABLE (new_layer)->parasites));
GIMP_DRAWABLE (new_layer)->parasites
= parasite_list_copy (GIMP_DRAWABLE (layer)->parasites);

View File

@ -822,9 +822,12 @@ file_prefs_filename_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *filename;
val = data;
file_prefs_strset (val, gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget)));
filename = gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget));
file_prefs_strset (val, filename);
g_free (filename);
}
static void
@ -832,9 +835,12 @@ file_prefs_path_callback (GtkWidget *widget,
gpointer data)
{
gchar **val;
gchar *path;
val = data;
file_prefs_strset (val, gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget)));
path = gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget));
file_prefs_strset (val, path);
g_free (path);
}
static void
@ -1140,7 +1146,6 @@ file_pref_cmd_callback (GtkWidget *widget,
old_monitor_yres = monitor_yres;
old_using_xserver_resolution = using_xserver_resolution;
old_num_processors = num_processors;
old_image_title_format = file_prefs_strdup (image_title_format);
old_global_paint_options = global_paint_options;
old_max_new_image_size = max_new_image_size;
old_thumbnail_mode = thumbnail_mode;
@ -1148,6 +1153,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_trust_dirty_flag = trust_dirty_flag;
old_use_help = use_help;
file_prefs_strset (&old_image_title_format, image_title_format);
file_prefs_strset (&old_temp_path, edit_temp_path);
file_prefs_strset (&old_swap_path, edit_swap_path);
file_prefs_strset (&old_plug_in_path, edit_plug_in_path);

View File

@ -234,7 +234,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs,
g_return_if_fail (gfs != NULL);
g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), g_strdup (filename));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename);
/* update everything
*/
@ -411,4 +411,5 @@ gimp_file_selection_check_filename (GimpFileSelection *gfs)
gtk_pixmap_set (GTK_PIXMAP (gfs->file_exists),
gfs->no_pixmap, gfs->no_mask);
}
g_free (filename);
}

View File

@ -234,7 +234,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs,
g_return_if_fail (gfs != NULL);
g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), g_strdup (filename));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename);
/* update everything
*/
@ -411,4 +411,5 @@ gimp_file_selection_check_filename (GimpFileSelection *gfs)
gtk_pixmap_set (GTK_PIXMAP (gfs->file_exists),
gfs->no_pixmap, gfs->no_mask);
}
g_free (filename);
}

View File

@ -234,7 +234,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs,
g_return_if_fail (gfs != NULL);
g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), g_strdup (filename));
gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename);
/* update everything
*/
@ -411,4 +411,5 @@ gimp_file_selection_check_filename (GimpFileSelection *gfs)
gtk_pixmap_set (GTK_PIXMAP (gfs->file_exists),
gfs->no_pixmap, gfs->no_mask);
}
g_free (filename);
}