Fix #114189: Workbench: VR Session crashes on exit #114795

Merged
Miguel Pozo merged 1 commits from pragma37/blender:pull-fix-vr-surface into blender-v4.0-release 2023-11-13 15:35:20 +01:00
1 changed files with 3 additions and 5 deletions
Showing only changes of commit 9c540d13bc - Show all commits

View File

@ -108,18 +108,16 @@ void wm_surface_add(wmSurface *surface)
void wm_surface_remove(wmSurface *surface)
{
if (surface == g_drawable) {
wm_surface_clear_drawable();
}
BLI_remlink(&global_surface_list, surface);
/* Ensure GPU context is bound to free GPU resources. */
wm_surface_make_drawable(surface);
surface->free_data(surface);
wm_surface_clear_drawable();
MEM_freeN(surface);
}
void wm_surfaces_free()
{
wm_surface_clear_drawable();
LISTBASE_FOREACH_MUTABLE (wmSurface *, surf, &global_surface_list) {
wm_surface_remove(surf);
}