diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-08-23 04:00:39 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-08-23 04:00:39 +0000 |
commit | 0ab69297216be8f95ba90657e6313f652ec3c7c8 (patch) | |
tree | 9483ce2824929a6460fc4f86072c5e98d2fda1b1 /ui/gtk/rlc_lte_graph.c | |
parent | 170dbf387cb63b7d5189d12abfeea93498917f47 (diff) |
Rationalise the way lists/elements are allocated.
svn path=/trunk/; revision=44623
Diffstat (limited to 'ui/gtk/rlc_lte_graph.c')
-rw-r--r-- | ui/gtk/rlc_lte_graph.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/gtk/rlc_lte_graph.c b/ui/gtk/rlc_lte_graph.c index 0d129642ef..71a5233eee 100644 --- a/ui/gtk/rlc_lte_graph.c +++ b/ui/gtk/rlc_lte_graph.c @@ -962,6 +962,8 @@ static void graph_segment_list_free(struct graph *g) static void graph_element_lists_initialize(struct graph *g) { g->elists = (struct element_list *)g_malloc0(sizeof(struct element_list)); + g->elists->elements = NULL; + g->elists->next = NULL; } static void graph_element_lists_make(struct graph *g) @@ -2455,10 +2457,6 @@ static void graph_read_config(struct graph *g) /* Time origin should be shown as time in capture by default */ g->style.flags = TIME_ORIGIN_CAP; - g->elists->next = (struct element_list *)g_malloc(sizeof(struct element_list)); - g->elists->next->next = NULL; - g->elists->next->elements = NULL; - g->y_axis->label = (const char ** )g_malloc(3 * sizeof(char * )); g->y_axis->label[0] = "Number"; g->y_axis->label[1] = "Sequence"; @@ -2497,6 +2495,10 @@ static void rlc_lte_make_elmtlist(struct graph *g) /* Allocate elements for data */ n = 1 + (5*data); e1 = elements1 = (struct element *)g_malloc(n*sizeof(struct element)); + + /* Allocate container for 2nd list of elements */ + g->elists->next = (struct element_list *)g_malloc0(sizeof(struct element_list)); + } else { e0 = elements0 = g->elists->elements; e1 = elements1 = g->elists->next->elements; |