mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
fix memory leak
This commit is contained in:
parent
4ec2fa2a71
commit
eaff188fa4
@ -197,6 +197,7 @@ static ret_t locale_info_deinit(locale_info_t* locale_info) {
|
|||||||
assets_manager_t* am = locale_info_get_assets_manager(locale_info);
|
assets_manager_t* am = locale_info_get_assets_manager(locale_info);
|
||||||
return_value_if_fail(locale_info != NULL, RET_OK);
|
return_value_if_fail(locale_info != NULL, RET_OK);
|
||||||
|
|
||||||
|
TKMEM_FREE(locale_info->name);
|
||||||
emitter_destroy(locale_info->emitter);
|
emitter_destroy(locale_info->emitter);
|
||||||
if (locale_info->strs != NULL) {
|
if (locale_info->strs != NULL) {
|
||||||
assets_manager_unref(am, locale_info->strs);
|
assets_manager_unref(am, locale_info->strs);
|
||||||
|
@ -295,7 +295,7 @@ ret_t tk_object_set_prop_pointer_ex(tk_object_t* obj, const char* name, void* va
|
|||||||
ret_t ret = RET_OK;
|
ret_t ret = RET_OK;
|
||||||
value_set_pointer_ex(&v, value, destroy);
|
value_set_pointer_ex(&v, value, destroy);
|
||||||
|
|
||||||
ret = tk_object_set_prop(obj, name, &v);
|
ret = tk_object_set_prop(obj, name, value_set_pointer_ex(&v, value, destroy));
|
||||||
value_reset(&v);
|
value_reset(&v);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -303,9 +303,8 @@ ret_t tk_object_set_prop_pointer_ex(tk_object_t* obj, const char* name, void* va
|
|||||||
|
|
||||||
ret_t tk_object_set_prop_object(tk_object_t* obj, const char* name, tk_object_t* value) {
|
ret_t tk_object_set_prop_object(tk_object_t* obj, const char* name, tk_object_t* value) {
|
||||||
value_t v;
|
value_t v;
|
||||||
value_set_object(&v, value);
|
|
||||||
|
|
||||||
return tk_object_set_prop(obj, name, &v);
|
return tk_object_set_prop(obj, name, value_set_object(&v, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
ret_t tk_object_set_prop_int(tk_object_t* obj, const char* name, int32_t value) {
|
ret_t tk_object_set_prop_int(tk_object_t* obj, const char* name, int32_t value) {
|
||||||
|
@ -1178,6 +1178,11 @@ TEST(Widget, get_style) {
|
|||||||
window_base_t* window_base = WINDOW_BASE(w);
|
window_base_t* window_base = WINDOW_BASE(w);
|
||||||
window_base->theme_obj = t;
|
window_base->theme_obj = t;
|
||||||
ASSERT_EQ(style_set_style_data(s, style_data, WIDGET_STATE_NORMAL), RET_OK);
|
ASSERT_EQ(style_set_style_data(s, style_data, WIDGET_STATE_NORMAL), RET_OK);
|
||||||
|
if (b->astyle != NULL) {
|
||||||
|
style_destroy(b->astyle);
|
||||||
|
b->astyle = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
b->astyle = s;
|
b->astyle = s;
|
||||||
|
|
||||||
value_set_int(&v, 123);
|
value_set_int(&v, 123);
|
||||||
@ -1498,6 +1503,7 @@ TEST(Widget, set_text) {
|
|||||||
|
|
||||||
widget_destroy(w);
|
widget_destroy(w);
|
||||||
locale_info_set(save_locale_info);
|
locale_info_set(save_locale_info);
|
||||||
|
locale_info_destroy(locale_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Widget, tr_text) {
|
TEST(Widget, tr_text) {
|
||||||
|
Loading…
Reference in New Issue
Block a user