From db6cfcf2111f2a9fc0e053e6337c0badf7c78609 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 4 Jan 2022 09:38:02 -0500 Subject: [PATCH] CeFunctionInfo ref counting fix --- IDEHelper/Compiler/CeMachine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index 142f5ac1..5c410c18 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -6455,6 +6455,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* if (moduleMethodInstance) { auto ceFunction = mCeMachine->QueueMethod(moduleMethodInstance.mMethodInstance, moduleMethodInstance.mFunc); + ceFunction->mCeFunctionInfo->mRefCount++; + mCeMachine->DerefMethodInfo(callEntry.mFunctionInfo); callEntry.mFunctionInfo = ceFunction->mCeFunctionInfo; } } @@ -8209,7 +8211,7 @@ BfMethodInstance* CeMachine::GetMethodInstance(int64 methodHandle) } CeFunction* CeMachine::QueueMethod(BfMethodInstance* methodInstance, BfIRValue func) -{ +{ if (mPreparingFunction != NULL) { auto curOwner = mPreparingFunction->mMethodInstance->GetOwner();