mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Cheap fix for load game menu crash
git-svn-id: https://svn.eduke32.com/eduke32@6957 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c5054af778
commit
ddd8b7e5bb
1 changed files with 9 additions and 2 deletions
|
@ -205,8 +205,11 @@ static void ReadSaveGameHeaders_Internal(void)
|
|||
// potentially overallocating but programmatically simple
|
||||
size_t const numfiles = countcache1dfind(findfiles_default);
|
||||
size_t const internalsavesize = sizeof(menusave_t) * numfiles;
|
||||
|
||||
g_internalsaves = (menusave_t *)Xrealloc(g_internalsaves, internalsavesize);
|
||||
g_internalsaves->clear();
|
||||
|
||||
if (internalsavesize)
|
||||
g_internalsaves->clear();
|
||||
|
||||
g_numinternalsaves = 0;
|
||||
ReadSaveGameHeaders_CACHE1D(findfiles_default);
|
||||
|
@ -222,8 +225,12 @@ static void ReadSaveGameHeaders_Internal(void)
|
|||
}
|
||||
}
|
||||
size_t const menusavesize = sizeof(menusave_t) * g_nummenusaves;
|
||||
|
||||
g_menusaves = (menusave_t *)Xrealloc(g_menusaves, menusavesize);
|
||||
g_menusaves->clear();
|
||||
|
||||
if (menusavesize)
|
||||
g_menusaves->clear();
|
||||
|
||||
for (size_t x = g_numinternalsaves-1, y = 0; x < g_numinternalsaves; --x)
|
||||
{
|
||||
menusave_t & msv = g_internalsaves[x];
|
||||
|
|
Loading…
Reference in a new issue