add IOC exit hook

This commit is contained in:
Michael Davidsaver
2013-03-30 14:59:31 -04:00
parent 40fb62a142
commit bb1924e80d

View File

@ -57,16 +57,24 @@ static pystate statenames[] = {
INITST(AfterCaServerPaused),
INITST(AfterDatabasePaused),
INITST(AfterIocPaused),
{(initHookState)9999, "AtIocExit"},
{(initHookState)0, NULL}
};
#undef INITST
static void pyhook(initHookState state);
static void cleanupPy(void *junk)
{
PyThreadState *state = PyGILState_GetThisThreadState();
PyEval_RestoreThread(state);
/* special "fake" hook for shutdown */
pyhook((initHookState)9999);
PyField_cleanup();
/* release extra reference for hooktable */