Fixed out-of-mem at end of combat caused by portrait blocking load of giant item table.

This commit is contained in:
Martin Haye 2019-12-28 11:43:12 -08:00
parent 41efac1db0
commit b73e1c53aa
3 changed files with 13 additions and 2 deletions

View File

@ -1276,8 +1276,12 @@ def processWin()#0
clearWindow
fin
// Make max space avail for item tables. Really oughta break them up sometime.
freePreloaded
freePortrait
needRender = FALSE
// Grab the loot
freePreloaded() // make max space avail for item tables
gold, xp = collectLootAndXP()
if gold > 0
displayf1("You find %d gold! ", addGold(gold))

View File

@ -53,6 +53,7 @@ import gamelib
predef first(p, sel)#1
predef forEach(p, do)#0
predef forSome(p, sel, do)#0
predef freePortrait()#0
predef getCharResponse()#1
predef getCursor()#2
predef getDir()#1

View File

@ -2152,13 +2152,19 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Display a portrait drawing (typically called from scripts)
export def clearPortrait()#0
export def freePortrait()#0
if curPortrait
auxMmgr(FREE_MEMORY, curPortrait)
curPortrait = NULL
curPortraitNum = 0
needRender = TRUE
fin
end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Display a portrait drawing (typically called from scripts)
export def clearPortrait()#0
freePortrait
if curFullscreenImg
auxMmgr(FREE_MEMORY, curFullscreenImg)
curFullscreenImg = NULL