Added msgpack_unpacked_destroy() call.
This commit is contained in:
Takatoshi Kondo 2021-04-24 15:25:37 +09:00
parent 08a42a347c
commit 4bc64de0ec
3 changed files with 4 additions and 1 deletions

View File

@ -100,6 +100,7 @@ int main(void) {
msgpack_object_print(stdout, obj); /*=> ["Hello", "MessagePack"] */
/* cleaning */
msgpack_unpacked_destroy(&msg);
msgpack_sbuffer_free(buffer);
msgpack_packer_free(pk);
}
@ -139,6 +140,7 @@ int main(void) {
/* prints the deserialized object. */
msgpack_object obj = msg.data;
msgpack_object_print(stdout, obj); /*=> ["Hello", "MessagePack"] */
msgpack_unpacked_destroy(&msg);
puts("");
}

View File

@ -25,6 +25,7 @@ void test()
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos) == MSGPACK_UNPACK_SUCCESS) {
}
msgpack_unpacked_destroy(&msg);
msgpack_sbuffer_destroy(&buf);
}

View File

@ -25,7 +25,7 @@ void test()
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos) == MSGPACK_UNPACK_SUCCESS) {
}
msgpack_unpacked_destroy(&msg);
msgpack_sbuffer_destroy(&buf);
}