mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Flush 2D on level memory purge
This commit is contained in:
parent
23b4b83c7c
commit
b7aa8c2464
1 changed files with 8 additions and 0 deletions
|
|
@ -8434,6 +8434,14 @@ void P_FreeLevelState(void)
|
||||||
HWR_ClearAllTextures();
|
HWR_ClearAllTextures();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (rendermode == render_soft)
|
||||||
|
{
|
||||||
|
// Queued draws might reference patches or colormaps about to be freed.
|
||||||
|
// Flush 2D to make sure no read-after-free occurs.
|
||||||
|
srb2::rhi::Rhi* rhi = srb2::sys::get_rhi(srb2::sys::g_current_rhi);
|
||||||
|
srb2::sys::main_hardware_state()->twodee_renderer->flush(*rhi, srb2::g_2d);
|
||||||
|
}
|
||||||
|
|
||||||
G_FreeGhosts(); // ghosts are allocated with PU_LEVEL
|
G_FreeGhosts(); // ghosts are allocated with PU_LEVEL
|
||||||
Patch_FreeTag(PU_PATCH_LOWPRIORITY);
|
Patch_FreeTag(PU_PATCH_LOWPRIORITY);
|
||||||
Patch_FreeTag(PU_PATCH_ROTATED);
|
Patch_FreeTag(PU_PATCH_ROTATED);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue