Skip to content

Commit

Permalink
Emscripten flush patch cache on level load
Browse files Browse the repository at this point in the history
  • Loading branch information
mazmazz committed May 29, 2020
1 parent 2a32b66 commit b3af270
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3509,6 +3509,12 @@ boolean P_LoadLevel(boolean fromnetsave)
// Clear pointers that would be left dangling by the purge
R_FlushTranslationColormapCache();

#ifdef __EMSCRIPTEN__
// Aggressive memory management to ensure we don't crash
Z_PreparePatchFlush();
Z_FlushCachedPatches();
R_ReloadHUDGraphics();
#endif
Z_FreeTags(PU_LEVEL, PU_PURGELEVEL - 1);

#if defined (WALLSPLATS) || defined (FLOORSPLATS)
Expand Down

0 comments on commit b3af270

Please sign in to comment.