mirror of
https://github.com/zlgopen/awtk.git
synced 2025-05-08 11:33:48 +08:00
fix memory leak in tests
This commit is contained in:
parent
05ae3ef044
commit
5394a511e5
@ -203,6 +203,7 @@ static ret_t foo_service_dispatch(foo_service_t* foo) {
|
||||
static ret_t foo_service_destroy(foo_service_t* foo) {
|
||||
return_value_if_fail(foo != NULL, RET_BAD_PARAMS);
|
||||
|
||||
str_reset(&foo->str);
|
||||
memset(foo, 0x00, sizeof(*foo));
|
||||
TKMEM_FREE(foo);
|
||||
|
||||
|
@ -97,6 +97,7 @@ static void test_foo(uint32_t retry_times, foo_service_args_t* args) {
|
||||
str_reset(&str);
|
||||
tk_service_destroy(service);
|
||||
foo_client_destroy(client);
|
||||
tk_thread_destroy(thread);
|
||||
}
|
||||
|
||||
TEST(foo, retry_times0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user