From d8f6b5758f42a6d6028e52198c8075d096f6c629 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 18 Sep 2001 04:00:56 +0000 Subject: remove redundant NULL checks since g_free handles NULLs. (e_text_destroy): 2001-09-17 Larry Ewing * gal/e-text/e-text.c (e_text_supply_selection): remove redundant NULL checks since g_free handles NULLs. (e_text_destroy): free the selection. It does appear to be a guarantee that we get a selection-clear event before we are destroyed. svn path=/trunk/; revision=12934 --- widgets/text/e-text.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 225fb610a7..fe2c8cac32 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -471,8 +471,9 @@ e_text_destroy (GtkObject *object) if (text->invisible) gtk_object_unref (GTK_OBJECT(text->invisible)); - if (text->lines) - g_free (text->lines); + g_free (text->lines); + g_free (text->primary_selection); + g_free (text->clipboard_selection); if (text->font) e_font_unref (text->font); @@ -3728,15 +3729,11 @@ e_text_supply_selection (EText *text, guint time, GdkAtom selection, guchar *dat invisible = e_text_get_invisible(text); if (selection == GDK_SELECTION_PRIMARY ) { - if (text->primary_selection) { - g_free (text->primary_selection); - } + g_free (text->primary_selection); text->primary_selection = g_strndup(data, length); text->primary_length = length; } else if (selection == clipboard_atom) { - if (text->clipboard_selection) { - g_free (text->clipboard_selection); - } + g_free (text->clipboard_selection); text->clipboard_selection = g_strndup(data, length); text->clipboard_length = length; } -- cgit