Only call PyMem_SetupDebugHooks() if DEBUG is 1.

We do not need the memory debug hooks in production environments.
This commit is contained in:
Joris Vink 2020-08-13 09:10:19 +02:00
parent d2617fdf32
commit eaef4b654a
1 changed files with 3 additions and 0 deletions

View File

@ -319,7 +319,10 @@ kore_python_init(void)
PyMem_SetAllocator(PYMEM_DOMAIN_OBJ, &allocator);
PyMem_SetAllocator(PYMEM_DOMAIN_MEM, &allocator);
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &allocator);
#if defined(KORE_DEBUG)
PyMem_SetupDebugHooks();
#endif
kore_msg_register(KORE_PYTHON_SEND_OBJ, python_kore_recvobj);