Free the lines even if there are no views. (#408018, Albert Huang)

2007-02-15  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextbtree.c (_gtk_text_btree_delete): Free the lines
        even if there are no views.  (#408018, Albert Huang)



svn path=/trunk/; revision=17302
This commit is contained in:
Matthias Clasen 2007-02-15 20:38:21 +00:00 committed by Matthias Clasen
parent 8e285edc3c
commit a2c86932f5
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-02-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextbtree.c (_gtk_text_btree_delete): Free the lines
even if there are no views. (#408018, Albert Huang)
2007-02-15 Cody Russell <bratsche@gnome.org>
* gdk/win32/gdkevents-win32.c: Make sure we get enough main context

View File

@ -738,6 +738,7 @@ _gtk_text_btree_delete (GtkTextIter *start,
GtkTextBTree *tree;
GtkTextLine *start_line;
GtkTextLine *end_line;
GtkTextLine *line;
GtkTextLine *deleted_lines = NULL; /* List of lines we've deleted */
gint start_byte_offset;
@ -989,7 +990,6 @@ _gtk_text_btree_delete (GtkTextIter *start,
view = tree->views;
while (view)
{
GtkTextLine *line;
GtkTextLineData *ld;
gint deleted_width = 0;
@ -1007,9 +1007,6 @@ _gtk_text_btree_delete (GtkTextIter *start,
deleted_height += ld->height;
}
if (!view->next)
gtk_text_line_destroy (tree, line);
line = next_line;
}
@ -1043,6 +1040,16 @@ _gtk_text_btree_delete (GtkTextIter *start,
view = view->next;
}
line = deleted_lines;
while (line)
{
GtkTextLine *next_line = line->next;
gtk_text_line_destroy (tree, line);
line = next_line;
}
/* avoid dangling pointer */
deleted_lines = NULL;