diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index 33b45fa45b..5a8f9c35d0 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -1774,9 +1774,6 @@ void gfx_display_init_white_texture(uintptr_t white_texture) ti.height = 1; ti.pixels = (uint32_t*)&white_data; - if (gfx_display_white_texture) - video_driver_texture_unload(&white_texture); - video_driver_texture_load(&ti, TEXTURE_FILTER_NEAREST, &white_texture); } diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 5db53ad198..bc9126e5a6 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -7746,6 +7746,9 @@ static void materialui_free(void *data) video_coord_array_free(&mui->font_data.list.raster_block.carr); video_coord_array_free(&mui->font_data.hint.raster_block.carr); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); + font_driver_bind_block(NULL, NULL); if (mui->thumbnail_path_data) @@ -7834,6 +7837,8 @@ static bool materialui_load_image(void *userdata, void *data, enum menu_image_ty materialui_context_bg_destroy(mui); video_driver_texture_load(data, TEXTURE_FILTER_MIPMAP_LINEAR, &mui->textures.bg); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); } @@ -8274,6 +8279,8 @@ static void materialui_context_reset(void *data, bool is_threaded) materialui_layout(mui, is_threaded); materialui_context_bg_destroy(mui); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); materialui_context_reset_textures(mui); materialui_context_reset_playlist_icons(mui); diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index ac586a15c4..bb10ba5b51 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -771,8 +771,6 @@ static void ozone_free(void *data) video_coord_array_free(&ozone->fonts.entries_sublabel.raster_block.carr); video_coord_array_free(&ozone->fonts.sidebar.raster_block.carr); - font_driver_bind_block(NULL, NULL); - ozone_free_list_nodes(&ozone->selection_buf_old, false); ozone_free_list_nodes(&ozone->horizontal_list, false); file_list_deinitialize(&ozone->selection_buf_old); @@ -784,6 +782,12 @@ static void ozone_free(void *data) if (ozone->thumbnail_path_data) free(ozone->thumbnail_path_data); } + + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); + + font_driver_bind_block(NULL, NULL); + gfx_animation_unset_update_time_cb(); } @@ -1167,6 +1171,8 @@ static void ozone_context_reset(void *data, bool is_threaded) } } + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); /* Horizontal list */ diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index ae8451d2f3..ca1f3f7031 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -4789,6 +4789,11 @@ static void rgui_free(void *data) if (rgui) { + if (rgui->widgets_supported) + { + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); + } if (rgui->thumbnail_path_data) free(rgui->thumbnail_path_data); } @@ -5664,7 +5669,11 @@ static void rgui_context_reset(void *data, bool is_threaded) #ifdef HAVE_GFX_WIDGETS if (rgui->widgets_supported) + { + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); + } #endif video_driver_monitor_reset(); } diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 02169ef101..55919d7c8e 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -3348,7 +3348,7 @@ static void *stripes_init(void **userdata, bool video_is_threaded) { unsigned width, height; int i; - stripes_handle_t *stripes = NULL; + stripes_handle_t *stripes = NULL; settings_t *settings = config_get_ptr(); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu)); float scale_value = settings->floats.menu_scale_factor * 100.0f; @@ -3493,6 +3493,9 @@ static void stripes_free(void *data) free(stripes->bg_file_path); } + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); + font_driver_bind_block(NULL, NULL); } @@ -3521,6 +3524,8 @@ static bool stripes_load_image(void *userdata, void *data, enum menu_image_type video_driver_texture_load(data, TEXTURE_FILTER_MIPMAP_LINEAR, &stripes->textures.bg); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); break; case MENU_IMAGE_THUMBNAIL: @@ -3694,6 +3699,8 @@ static void stripes_context_reset_textures( for (i = 0; i < STRIPES_TEXTURE_LAST; i++) gfx_display_reset_textures_list(stripes_texture_path(i), iconpath, &stripes->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); stripes->main_menu_node.icon = stripes->textures.list[STRIPES_TEXTURE_MAIN_MENU]; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index dee7179860..c5f1c63d8c 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -5715,6 +5715,9 @@ static void xmb_free(void *data) free(xmb->thumbnail_path_data); } + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); + font_driver_bind_block(NULL, NULL); gfx_animation_unset_update_time_cb(); @@ -5741,6 +5744,8 @@ static bool xmb_load_image(void *userdata, void *data, case MENU_IMAGE_WALLPAPER: xmb_context_bg_destroy(xmb); video_driver_texture_unload(&xmb->textures.bg); + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); video_driver_texture_load(data, TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->textures.bg); @@ -6018,6 +6023,8 @@ static void xmb_context_reset_textures( xmb->assets_missing = false; + if (gfx_display_white_texture) + video_driver_texture_unload(&gfx_display_white_texture); gfx_display_init_white_texture(gfx_display_white_texture); for (i = 0; i < XMB_TEXTURE_LAST; i++)