Fix crash editing anisotropic filter preference from background mode

This commit is contained in:
Brecht Van Lommel 2022-06-21 15:41:36 +02:00
parent 9622dace3e
commit d2f47017b9
2 changed files with 6 additions and 2 deletions

View File

@ -177,7 +177,7 @@ void GPU_render_step()
/** \name Backend selection
* \{ */
static GPUBackend *g_backend;
static GPUBackend *g_backend = nullptr;
bool GPU_backend_supported(eGPUBackendType type)
{

View File

@ -702,7 +702,11 @@ void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *r_size)
void GPU_samplers_update()
{
GPUBackend::get()->samplers_update();
/* Backend may not exist when we are updating preferences from background mode. */
GPUBackend *backend = GPUBackend::get();
if (backend) {
backend->samplers_update();
}
}
/** \} */