add IOC exit hook
This commit is contained in:
@ -57,16 +57,24 @@ static pystate statenames[] = {
|
|||||||
INITST(AfterCaServerPaused),
|
INITST(AfterCaServerPaused),
|
||||||
INITST(AfterDatabasePaused),
|
INITST(AfterDatabasePaused),
|
||||||
INITST(AfterIocPaused),
|
INITST(AfterIocPaused),
|
||||||
|
|
||||||
|
{(initHookState)9999, "AtIocExit"},
|
||||||
|
|
||||||
{(initHookState)0, NULL}
|
{(initHookState)0, NULL}
|
||||||
};
|
};
|
||||||
#undef INITST
|
#undef INITST
|
||||||
|
|
||||||
|
static void pyhook(initHookState state);
|
||||||
|
|
||||||
static void cleanupPy(void *junk)
|
static void cleanupPy(void *junk)
|
||||||
{
|
{
|
||||||
PyThreadState *state = PyGILState_GetThisThreadState();
|
PyThreadState *state = PyGILState_GetThisThreadState();
|
||||||
|
|
||||||
PyEval_RestoreThread(state);
|
PyEval_RestoreThread(state);
|
||||||
|
|
||||||
|
/* special "fake" hook for shutdown */
|
||||||
|
pyhook((initHookState)9999);
|
||||||
|
|
||||||
PyField_cleanup();
|
PyField_cleanup();
|
||||||
|
|
||||||
/* release extra reference for hooktable */
|
/* release extra reference for hooktable */
|
||||||
|
Reference in New Issue
Block a user