fixed memory leak on minimized due to missing deletion of unused textures (fixes parts of #14245)