From ffe072f694266f6226821c4760adb4f7a95d02f6 Mon Sep 17 00:00:00 2001 From: Fabian Kirsch Date: Thu, 16 Jan 2014 12:28:47 +0100 Subject: [PATCH] parse: Some minor fixes Fix destructor segfaulting Expect 0 grammar-ambiguities Fix order of bin-properties assignment https://bugzilla.gnome.org/show_bug.cgi?id=710034 --- gst/parse/grammar.y | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 5279dd71c9..3f0513ee39 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -629,6 +629,9 @@ static int yyerror (void *scanner, graph_t *graph, const char *s); graph_t *gg; } +/* No grammar ambiguities expected, FAIL otherwise */ +%expect 0 + %token PARSE_URL %token IDENTIFIER %left REF PADREF BINREF @@ -644,7 +647,8 @@ static int yyerror (void *scanner, graph_t *graph, const char *s); %type morepads pads assignments %destructor { gst_parse_strfree ($$); } -%destructor { gst_parse_free_chain($$); } +%destructor { if($$) + gst_parse_free_chain($$); } %destructor { gst_parse_free_link ($$); } %destructor { gst_parse_free_reference(&($$));} %destructor { gst_object_unref ($$); } @@ -934,7 +938,7 @@ chainlist: /* NOP */ { $$ = NULL; } assignments: /* NOP */ { $$ = NULL; } - | assignments ASSIGNMENT { $$ = g_slist_prepend ($1, $2); } + | ASSIGNMENT assignments { $$ = g_slist_prepend ($2, $1); } ; binopener: '(' { $$ = gst_parse_strdup(_("bin")); } @@ -1144,9 +1148,8 @@ out: error1: if (g.chain) { - g_slist_foreach (g.chain->elements, (GFunc)gst_object_unref, NULL); - g_slist_free (g.chain->elements); gst_parse_free_chain (g.chain); + g.chain=NULL; } g_slist_foreach (g.links, (GFunc)gst_parse_free_link, NULL);