summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2013-09-09 12:12:21 (GMT)
committerLarry Hastings <larry@hastings.org>2013-09-09 12:12:21 (GMT)
commit8568f66daf088cf235a42288621fb4770ac48199 (patch)
tree3db459417e7c4b112b03d59661057f09ff058d07 /Python
parent60560b18d29a917e64d88d47c5533743001f0787 (diff)
parent23543ebd8676384c1c5e28f7a1496777a57479d5 (diff)
downloadcpython-8568f66daf088cf235a42288621fb4770ac48199.zip
cpython-8568f66daf088cf235a42288621fb4770ac48199.tar.gz
cpython-8568f66daf088cf235a42288621fb4770ac48199.tar.bz2
Merge.
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 924b6a2..ecd00ce 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -208,6 +208,8 @@ new_threadstate(PyInterpreterState *interp, int init)
tstate->trash_delete_nesting = 0;
tstate->trash_delete_later = NULL;
+ tstate->on_delete = NULL;
+ tstate->on_delete_data = NULL;
if (init)
_PyThreadState_Init(tstate);
@@ -390,6 +392,9 @@ tstate_delete_common(PyThreadState *tstate)
if (tstate->next)
tstate->next->prev = tstate->prev;
HEAD_UNLOCK();
+ if (tstate->on_delete != NULL) {
+ tstate->on_delete(tstate->on_delete_data);
+ }
PyMem_RawFree(tstate);
}