Drop the _delete field from struct json_object and call the type-specific delete functions directly from json_object_put. (Thanks @dota17 for the suggestion in PR #632!)

This commit is contained in:
Eric Haszlakiewicz
2020-06-13 18:34:35 +00:00
parent 4c10712114
commit 5ebfeaedc5
2 changed files with 30 additions and 19 deletions

View File

@@ -29,8 +29,6 @@ struct json_object;
typedef SSIZE_T ssize_t;
#endif
typedef void (json_object_private_delete_fn)(struct json_object *o);
/* json object int type, support extension*/
typedef enum json_object_int_type
{
@@ -42,7 +40,6 @@ struct json_object
{
enum json_type o_type;
uint32_t _ref_count;
json_object_private_delete_fn *_delete;
json_object_to_json_string_fn *_to_json_string;
struct printbuf *_pb;
json_object_delete_fn *_user_delete;