aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-08-16 19:31:52 +0200
committerThomas White <taw@bitwiz.org.uk>2015-08-16 19:31:52 +0200
commitb68b17261aa394d0b0c0a7ddd058c987385637ad (patch)
tree4132f48efa7404993b293a31013707255dbaeffe /src/frame.c
parent321afdd0e417c701fbf9797ccfc3fd59a86d4dc2 (diff)
Rerender means full rerender
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/frame.c b/src/frame.c
index 9f23d17..ebd30ce 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -82,40 +82,27 @@ void frame_free(struct frame *fr)
{
int i;
- free(fr->boxes);
- for ( i=0; i<fr->num_children; i++ ) {
- frame_free(fr->children[i]);
- }
- free(fr->children);
- free(fr);
-}
-
-
-void renew_frame(struct frame *fr)
-{
- int i;
-
if ( fr == NULL ) return;
+ /* Free all lines */
for ( i=0; i<fr->n_lines; i++ ) {
wrap_line_free(&fr->lines[i]);
}
free(fr->lines);
- fr->lines = NULL;
- fr->n_lines = 0;
- fr->max_lines = 0;
+ /* Free unwrapped boxes */
if ( fr->boxes != NULL ) {
free(fr->boxes->boxes);
free(fr->boxes);
}
- fr->boxes = malloc(sizeof(struct wrap_line));
- initialise_line(fr->boxes);
- fr->visited = 0;
+ /* Free all children */
for ( i=0; i<fr->num_children; i++ ) {
- renew_frame(fr->children[i]);
+ frame_free(fr->children[i]);
}
+ free(fr->children);
+
+ free(fr);
}