diff options
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r-- | src/glibext/gcodebuffer.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c index a7e522c..8633461 100644 --- a/src/glibext/gcodebuffer.c +++ b/src/glibext/gcodebuffer.c @@ -156,6 +156,7 @@ struct _GBufferView BufferLineColumn last_merge; /* Colonne de fusion extrême */ segcnt_list *highlighted; /* Segments mis en évidence */ + bool external; /* Note l'origine de la liste */ }; @@ -917,8 +918,6 @@ static void g_buffer_view_init(GBufferView *buffer) g_buffer_view_reset_required_height(buffer); g_buffer_view_reset_required_widths(buffer); - buffer->highlighted = init_segment_content_list(); - } @@ -955,7 +954,8 @@ static void g_buffer_view_dispose(GBufferView *view) static void g_buffer_view_finalize(GBufferView *view) { - exit_segment_content_list(view->highlighted); + if (!view->external) + exit_segment_content_list(view->highlighted); G_OBJECT_CLASS(g_buffer_view_parent_class)->finalize(G_OBJECT(view)); @@ -975,7 +975,7 @@ static void g_buffer_view_finalize(GBufferView *view) * * ******************************************************************************/ -GBufferView *g_buffer_view_new(GCodeBuffer *buffer) +GBufferView *g_buffer_view_new(GCodeBuffer *buffer, segcnt_list *highlighted) { GBufferView *result; /* Composant à retourner */ @@ -987,6 +987,13 @@ GBufferView *g_buffer_view_new(GCodeBuffer *buffer) g_buffer_view_restrict(result, NULL, NULL); + if (highlighted != NULL) + result->highlighted = highlighted; + else + result->highlighted = init_segment_content_list(); + + result->external = (highlighted != NULL); + return result; } |