Skip to content

Commit debc63b

Browse files
committed
Fixed a crash caused by Function's convention being freed twice when Source.Python is unloading.
1 parent 8502e1b commit debc63b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/modules/memory/memory_function.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ void CFunction::AddHook(HookType_t eType, PyObject* pCallable)
381381

382382
if (!pHook) {
383383
pHook = HookFunctionHelper((void *) m_ulAddr, m_pCallingConvention);
384+
385+
// DynamicHooks will handle our convention from there, regardless if we allocated it or not.
386+
m_bAllocatedCallingConvention = false;
384387
}
385388

386389
// Add the hook handler. If it's already added, it won't be added twice

0 commit comments

Comments
 (0)