This commit is contained in:
lixianjing 2024-03-15 15:31:39 +08:00
commit db6e50070f
4 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# 最新动态
2024/03/15
* 修复内存泄露。
* 修复change locale导致崩溃的问题(感谢颖健发现问题)
2024/03/14
* 补充调试信息(感谢兆坤提供补丁)
* 完善doc (感谢兆坤提供补丁)

View File

@ -625,6 +625,12 @@ ret_t assets_manager_clear_all_cache(assets_manager_t* am) {
return RET_OK;
}
ret_t assets_manager_clear_font_cache(assets_manager_t* am) {
assets_manager_clear_cache(am, ASSET_TYPE_FONT);
return RET_OK;
}
ret_t assets_manager_set_theme(assets_manager_t* am, const char* theme) {
return_value_if_fail(am != NULL, RET_BAD_PARAMS);

View File

@ -385,6 +385,15 @@ ret_t assets_manager_clear_cache_ex(assets_manager_t* am, asset_type_t type, con
*/
ret_t assets_manager_clear_all_cache(assets_manager_t* am);
/**
* @method assets_manager_clear_font_cache
*
* @param {assets_manager_t*} am asset manager对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t assets_manager_clear_font_cache(assets_manager_t* am);
/**
* @method assets_manager_clear_all
*

View File

@ -490,9 +490,9 @@ static ret_t wm_on_locale_changed(void* ctx, event_t* e) {
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
return_value_if_fail(fm != NULL && imm != NULL, RET_BAD_PARAMS);
assets_manager_clear_all_cache(am);
font_manager_unload_all(fm);
image_manager_unload_all(imm);
assets_manager_clear_font_cache(am);
if (widget_count_children(widget) > 0) {
widget_reset_canvas(widget_get_child(widget, 0));