mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed CeContext leak
This commit is contained in:
parent
ef9464900e
commit
27a00b64ba
1 changed files with 1 additions and 2 deletions
|
@ -2456,6 +2456,7 @@ void BfModule::HandleCEAttributes(CeEmitContext* ceEmitContext, BfTypeInstance*
|
|||
|
||||
SetAndRestoreValue<CeEmitContext*> prevEmitContext(mCompiler->mCeMachine->mCurEmitContext, ceEmitContext);
|
||||
auto ceContext = mCompiler->mCeMachine->AllocContext();
|
||||
defer({ mCompiler->mCeMachine->ReleaseContext(ceContext); });
|
||||
|
||||
BfIRValue attrVal =ceContext->CreateAttribute(customAttribute.mRef, this, typeInstance->mConstHolder, &customAttribute);
|
||||
for (int baseIdx = 0; baseIdx < checkDepth; baseIdx++)
|
||||
|
@ -2592,8 +2593,6 @@ void BfModule::HandleCEAttributes(CeEmitContext* ceEmitContext, BfTypeInstance*
|
|||
UpdateCEEmit(ceEmitContext, typeInstance, customAttribute.mDeclaringType, ctxStr, customAttribute.mRef, BfCeTypeEmitSourceKind_Type);
|
||||
}
|
||||
}
|
||||
|
||||
mCompiler->mCeMachine->ReleaseContext(ceContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue