mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
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:
parent
8e285edc3c
commit
a2c86932f5
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user