diff --git a/ChangeLog b/ChangeLog index 8c164d920c..ddcc707f57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Nov 6 19:16:57 *ET 1999 Sven Neumann + + * 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 * app/gdisplay.h: Reverted my latest change. It disturbed image diff --git a/app/about_dialog.c b/app/about_dialog.c index e2aa586f12..3901d9532a 100644 --- a/app/about_dialog.c +++ b/app/about_dialog.c @@ -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); diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 3a2248a6b7..9e1453032f 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -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); diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c index 0aa9befe39..289415540d 100644 --- a/app/core/gimpobject.c +++ b/app/core/gimpobject.c @@ -10,16 +10,17 @@ gimp_object_class_init (GimpObjectClass *gobjectclass) { } -GtkType gimp_object_get_type (void) +GtkType +gimp_object_get_type (void) { - static GtkType type; - GIMP_TYPE_INIT(type, - GimpObject, - GimpObjectClass, - gimp_object_init, - gimp_object_class_init, - GTK_TYPE_OBJECT); - return type; + static GtkType type = 0; + GIMP_TYPE_INIT(type, + GimpObject, + GimpObjectClass, + gimp_object_init, + gimp_object_class_init, + GTK_TYPE_OBJECT); + return type; } diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index e2aa586f12..3901d9532a 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -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); diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index ffc7c7915f..df3b6ad341 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -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); diff --git a/app/gimplayer.c b/app/gimplayer.c index 3a2248a6b7..9e1453032f 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -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); diff --git a/app/gimpobject.c b/app/gimpobject.c index 0aa9befe39..289415540d 100644 --- a/app/gimpobject.c +++ b/app/gimpobject.c @@ -10,16 +10,17 @@ gimp_object_class_init (GimpObjectClass *gobjectclass) { } -GtkType gimp_object_get_type (void) +GtkType +gimp_object_get_type (void) { - static GtkType type; - GIMP_TYPE_INIT(type, - GimpObject, - GimpObjectClass, - gimp_object_init, - gimp_object_class_init, - GTK_TYPE_OBJECT); - return type; + static GtkType type = 0; + GIMP_TYPE_INIT(type, + GimpObject, + GimpObjectClass, + gimp_object_init, + gimp_object_class_init, + GTK_TYPE_OBJECT); + return type; } diff --git a/app/gimprc.c b/app/gimprc.c index 163b5c5fbd..233412a97c 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -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; } diff --git a/app/gui/about-dialog.c b/app/gui/about-dialog.c index e2aa586f12..3901d9532a 100644 --- a/app/gui/about-dialog.c +++ b/app/gui/about-dialog.c @@ -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); diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index ffc7c7915f..df3b6ad341 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -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); diff --git a/app/layer.c b/app/layer.c index 3a2248a6b7..9e1453032f 100644 --- a/app/layer.c +++ b/app/layer.c @@ -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); diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index ffc7c7915f..df3b6ad341 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -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); diff --git a/libgimp/gimpfileselection.c b/libgimp/gimpfileselection.c index af4434fe1f..a35c1ebc5a 100644 --- a/libgimp/gimpfileselection.c +++ b/libgimp/gimpfileselection.c @@ -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); } diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c index af4434fe1f..a35c1ebc5a 100644 --- a/libgimpwidgets/gimpfileentry.c +++ b/libgimpwidgets/gimpfileentry.c @@ -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); } diff --git a/libgimpwidgets/gimpfileselection.c b/libgimpwidgets/gimpfileselection.c index af4434fe1f..a35c1ebc5a 100644 --- a/libgimpwidgets/gimpfileselection.c +++ b/libgimpwidgets/gimpfileselection.c @@ -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); }