[model] Reset mod_numknown when clearing models

Vulkan actually needs Mod_ClearAll, and mod_numknown not getting reset
was the actual cause of the segfault.
This commit is contained in:
Bill Currie 2023-03-06 21:04:00 +09:00
parent 488ccdc512
commit 5821ef8d1f
2 changed files with 2 additions and 0 deletions

View file

@ -178,6 +178,7 @@ Mod_ClearAll (void)
for (i = 0; i < mod_numknown; i++) { for (i = 0; i < mod_numknown; i++) {
mod_unload_model (i); mod_unload_model (i);
} }
mod_numknown = 0;
} }
model_t * model_t *

View file

@ -725,6 +725,7 @@ vulkan_vid_render_shutdown (void)
QFV_DeviceWaitIdle (device); QFV_DeviceWaitIdle (device);
SCR_Shutdown (); SCR_Shutdown ();
Mod_ClearAll ();
Vulkan_Compose_Shutdown (vulkan_ctx); Vulkan_Compose_Shutdown (vulkan_ctx);
Vulkan_Translucent_Shutdown (vulkan_ctx); Vulkan_Translucent_Shutdown (vulkan_ctx);