aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-02-14 19:27:52 +0100
committerThomas White <taw@bitwiz.org.uk>2015-02-15 16:48:50 +0100
commitd41cf4ce1b1eddc030a85293ca7174e4c36750ce (patch)
tree2a06ed4153ad27009adbe3a1675cf89b81b38d56
parent0a9a7aa1ddf4602798d975747d83db8a17907ecc (diff)
Don't free logical stuff
All this stuff needs to be kept around for future re-rendering
-rw-r--r--src/sc_editor.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index 1331174..8f42c69 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -1346,58 +1346,9 @@ static gint realise_sig(GtkWidget *da, SCEditor *e)
}
-static void unset_all_frames(SCBlock *bl)
-{
- while ( bl != NULL ) {
- sc_block_set_frame(bl, NULL);
- if ( sc_block_child(bl) != NULL ) {
- unset_all_frames(sc_block_child(bl));
- }
- if ( sc_block_macro_child(bl) != NULL ) {
- unset_all_frames(sc_block_macro_child(bl));
- }
- bl = sc_block_next(bl);
- }
-}
-
-
-static void free_frame_contents(struct frame *fr)
-{
- int i;
-
- if ( fr == NULL ) return;
-
- 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;
-
- if ( fr->boxes != NULL ) {
- free(fr->boxes->boxes);
- free(fr->boxes);
- }
-
- fr->boxes = NULL;
-
- for ( i=0; i<fr->num_children; i++ ) {
- free_frame_contents(fr->children[i]);
- }
-
- fr->num_children = 0;
-}
-
-
void sc_editor_set_scblock(SCEditor *e, SCBlock *scblocks)
{
- unset_all_frames(e->scblocks);
e->scblocks = scblocks;
-
- /* Free all subframes */
- free_frame_contents(sc_block_frame(e->scblocks));
-
rerender(e);
redraw_editor(e);
}