Skip to content

Fixed: the game would crash upon close if any lump handles opened in ACS weren't closed by mods properly.

Adam Kaminski requested to merge topic/default/acs-lump-crash-fix into branch/default

If a mod utilized the lump reading API in ACS and opened any lumps without properly closing them, the game would crash upon close. The lump handle list (i.e. TMap<int, struct ACSRefCountedLumpHandle> ACSLumpHandles) must be cleared before the lump resources themselves are deleted from memory, such that FResourceLump *FWadLump::Lump isn't an invalid pointer by the time an FWadLump object in the aforementioned list is deleted automatically:

FWadLump::~FWadLump()
{
	if (Lump != NULL)
	{
		Lump->ReleaseCache();
	}
}

Additionally, the lump handle list is now cleared when global ACS variables are cleared (e.g. when a new game starts). They aren't needed anymore when this occurs.

Merge request reports

Loading