diff --git a/src/base/locale_info.c b/src/base/locale_info.c index ca2d90cf1..b465e5a83 100644 --- a/src/base/locale_info.c +++ b/src/base/locale_info.c @@ -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); return_value_if_fail(locale_info != NULL, RET_OK); + TKMEM_FREE(locale_info->name); emitter_destroy(locale_info->emitter); if (locale_info->strs != NULL) { assets_manager_unref(am, locale_info->strs); diff --git a/src/tkc/object.c b/src/tkc/object.c index 53257ed0c..6245bf3aa 100644 --- a/src/tkc/object.c +++ b/src/tkc/object.c @@ -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; 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); 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) { 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) { diff --git a/tests/widget_test.cc b/tests/widget_test.cc index 00560b6af..0b1d3c7dc 100644 --- a/tests/widget_test.cc +++ b/tests/widget_test.cc @@ -1178,6 +1178,11 @@ TEST(Widget, get_style) { window_base_t* window_base = WINDOW_BASE(w); window_base->theme_obj = t; 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; value_set_int(&v, 123); @@ -1498,6 +1503,7 @@ TEST(Widget, set_text) { widget_destroy(w); locale_info_set(save_locale_info); + locale_info_destroy(locale_info); } TEST(Widget, tr_text) {