diff options
-rw-r--r-- | json-glib/json-gobject.c | 4 | ||||
-rw-r--r-- | tests/test-01.c | 2 | ||||
-rw-r--r-- | tests/test-02.c | 2 | ||||
-rw-r--r-- | tests/test-03.c | 2 |
4 files changed, 2 insertions, 8 deletions
diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c index 0526283..b0a0e13 100644 --- a/json-glib/json-gobject.c +++ b/json-glib/json-gobject.c @@ -581,7 +581,7 @@ json_construct_gobject (GType gtype, } root = json_parser_get_root (parser); - if (JSON_NODE_TYPE (root) != JSON_NODE_OBJECT) + if (root == NULL || JSON_NODE_TYPE (root) != JSON_NODE_OBJECT) { g_set_error (error, JSON_PARSER_ERROR, JSON_PARSER_ERROR_PARSE, @@ -652,8 +652,6 @@ json_construct_gobject (GType gtype, g_list_free (members); - json_node_free (root); - g_object_thaw_notify (retval); g_type_class_unref (klass); diff --git a/tests/test-01.c b/tests/test-01.c index 4008a1d..543803e 100644 --- a/tests/test-01.c +++ b/tests/test-01.c @@ -23,7 +23,7 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } - g_assert (NULL == json_parser_peek_root (parser)); + g_assert (NULL == json_parser_get_root (parser)); g_object_unref (parser); diff --git a/tests/test-02.c b/tests/test-02.c index bfc1388..46938ef 100644 --- a/tests/test-02.c +++ b/tests/test-02.c @@ -217,8 +217,6 @@ main (int argc, char *argv[]) g_print ("*** Test %d: assigns '%s'\n", i, var_name); print_array (1, array); - - json_node_free (node); } g_object_unref (parser); diff --git a/tests/test-03.c b/tests/test-03.c index baff9ba..6dfe4f8 100644 --- a/tests/test-03.c +++ b/tests/test-03.c @@ -206,8 +206,6 @@ main (int argc, char *argv[]) g_print ("*** Test %d: '%s' ***\n", i, test_objects[i]); print_object (1, object); - - json_node_free (node); } g_object_unref (parser); |