Ryan-rsm-McKenzie / CommonLibSSE

A reverse engineered library for hacking Skyrim Special Edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access Violation in RegistrationSetBase dtor on game exit

SteveTownsend opened this issue · comments

Had to remove RAII usage of this class to avoid an AV when game is closing down. The VM seems non-viable for cleanup of this class. I have a work-round (don't use RAII, just let them leak on exit, who cares?) but for other use cases this might matter.

In general, there does not seem to be a good pattern for DLL resource cleanup - I also had to revert to using the VM to manage this part of my mod's lifecycle. I don't think this is fixable unless there is some event OnGameExit or similar, I just found it interesting.

Code comment on the fix I made is below:

/* do not clean this class up: SKSE::RegistrationSetBase::~Impl (?) faults per https://github.com/SteveTownsend/SmartHarvestSE/issues/200
* 
From Map file
	0001:0009a310       ??1RegistrationSetBase@Impl@SKSE@@QEAA@XZ 000000018009b310 f   CommonLibSSE:RegistrationSet.obj

WER output crash address:
	Sig[3].Value=SmartHarvestSE.dll
	Sig[6].Name=Exception Code
	Sig[6].Value=c0000005
	Sig[7].Name=Exception Offset
	Sig[7].Value=000000000009b343
*/