We allocate a Zap in CreatePDBWorker, but we never deallocate it.
Assuming the object instance is no longer needed, this fixes a memory
leak.
BEGIN_ENTRYPOINT_NOTHROW;
- Zapper* zap = NULL;
-
EX_TRY
{
GetCompileInfo()->SetIsGeneratingNgenPDB(TRUE);
NGenOptions ngo = {0};
ngo.dwSize = sizeof(NGenOptions);
- zap = Zapper::NewZapper(&ngo);
+ NewHolder<Zapper> zap(Zapper::NewZapper(&ngo));
#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
zap->SetDontLoadJit();