2007-10-27 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/json/json-parser.c:
	(json_scanner_msg_handler): Set the GError to be returned by
	the parsing functions into the GScanner error message handler.

	(json_parser_object): Return the symbol token in case we have
	a parse error after the member name.

	(json_parser_load_from_data): Propagate the error set in the
	message handler, if any.

	* clutter/json/json-node.c (json_node_free): Unref the objects
	only if are set, to avoid a couple of needless criticals we
	get on error.

	* tests/test-script.json: More properties.
This commit is contained in:
Emmanuele Bassi
2007-10-27 19:49:39 +00:00
parent 35132fb5de
commit d42153dc69
4 changed files with 48 additions and 10 deletions

View File

@ -332,11 +332,13 @@ json_node_free (JsonNode *node)
switch (node->type)
{
case JSON_NODE_OBJECT:
json_object_unref (node->data.object);
if (node->data.object)
json_object_unref (node->data.object);
break;
case JSON_NODE_ARRAY:
json_array_unref (node->data.array);
if (node->data.array)
json_array_unref (node->data.array);
break;
case JSON_NODE_VALUE: