From a503b8859c37906ab5012db163daca43bfe393bb Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 21 May 2011 17:35:21 -0700 Subject: Make all handlers objects refcounted. I'm realizing that basically all upb objects will need to be refcounted to be sharable across languages, but *not* messages which are on their way out so we can get out of the business of data representations. Things which must be refcounted: - encoders, decoders - handlers objects - defs --- tests/tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/tests.c b/tests/tests.c index 747593a..a78ca03 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -38,15 +38,15 @@ static void test_upb_jit() { upb_string_unref(symname); ASSERT(def); - upb_handlers h; - upb_handlers_init(&h); + upb_handlers *h = upb_handlers_new(); upb_handlerset hset = {NULL, NULL, &upb_test_onvalue, NULL, NULL, NULL, NULL}; - upb_handlers_reghandlerset(&h, upb_downcast_msgdef(def), &hset); + upb_handlers_reghandlerset(h, upb_downcast_msgdef(def), &hset); upb_decoder d; - upb_decoder_init(&d, &h); + upb_decoder_init(&d, h); upb_decoder_uninit(&d); upb_symtab_unref(s); upb_def_unref(def); + upb_handlers_unref(h); } static void test_upb_symtab() { -- cgit v1.2.3