X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawing.c;h=28934be2dc5f27b271f668e6d451bb903ed1b851;hb=f16a5569e0071a47d2f658225045e8c75de1a7c6;hp=64abc0bdf54e6578122a19af5da272d6bd955447;hpb=7893f726b92c58d32505219ea5275d138c3ee3ff;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 64abc0bd..28934be2 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -858,6 +858,12 @@ Drawing_t *drawing_construct(ControlFlowData *control_flow_data) gtk_widget_show(drawing->scrollbar); gtk_widget_show(drawing->hbox); + /* Allocate the colors */ + GdkColormap* colormap = gdk_colormap_get_system(); + + gdk_colormap_alloc_colors(colormap, drawing_colors, NUM_COLORS, FALSE, + TRUE, NULL); + return drawing; } @@ -865,6 +871,14 @@ Drawing_t *drawing_construct(ControlFlowData *control_flow_data) void drawing_destroy(Drawing_t *drawing) { g_info("drawing_destroy %p", drawing); + + /* Free the colors */ + GdkColormap* colormap = gdk_colormap_get_system(); + + gdk_colormap_free_colors(colormap, drawing_colors, NUM_COLORS); + + + // Do not unref here, Drawing_t destroyed by it's widget. //g_object_unref( G_OBJECT(drawing->drawing_area)); if(drawing->gc != NULL)