From 6c022374cbdad132f62ac6a89585bc8297aa9c05 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 26 Jan 2014 04:42:36 +0100 Subject: [PATCH] Fix a reference counting issue that broke update notifications in 2014-01-03. Luckily, this is thcrap and there is still the possibility for nifty workarounds to deal with the problem that every user of 2014-01-03 will never see any regular update notification... --- thcrap/src/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thcrap/src/init.c b/thcrap/src/init.c index fc2d8e9b..d989a686 100644 --- a/thcrap/src/init.c +++ b/thcrap/src/init.c @@ -273,7 +273,8 @@ int thcrap_init(const char *run_cfg_fn) // Why, hello there, C89. int dummy = patch_rel_to_abs(patch_info, run_cfg_fn); - json_array_set_new(patches, i, patch_init(patch_info)); + patch_info = patch_init(patch_info); + json_array_set(patches, i, patch_info); cur_min_build = json_object_get_hex(patch_info, "min_build"); if(cur_min_build > min_build) { @@ -286,6 +287,7 @@ int thcrap_init(const char *run_cfg_fn) min_build = cur_min_build; url_engine = json_object_get_string(patch_info, "url_engine"); } + json_decref(patch_info); } if(min_build > PROJECT_VERSION()) { char format[11];