mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Merge branch 'eid-flush-2d-before-levelpurge' into 'master'
Flush 2D on level memory purge Closes #1574 See merge request kart-krew-dev/ring-racers-internal!2686
This commit is contained in:
commit
6b7c1252c7
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