From: Vincent Pit Date: Mon, 29 Sep 2014 15:19:14 +0000 (+0200) Subject: Nullify thread local storage entries when they are freed X-Git-Tag: v0.33~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=2cba38dec0a1ccaeb6ff4119ee2af3ae634e739c;p=perl%2Fmodules%2Findirect.git Nullify thread local storage entries when they are freed This makes possible problems easier to reproduce. --- diff --git a/indirect.xs b/indirect.xs index db56379..5cd420c 100644 --- a/indirect.xs +++ b/indirect.xs @@ -327,8 +327,11 @@ STATIC void indirect_thread_cleanup(pTHX_ void *ud) { dMY_CXT; SvREFCNT_dec(MY_CXT.global_code); + MY_CXT.global_code = NULL; ptable_free(MY_CXT.map); + MY_CXT.map = NULL; ptable_hints_free(MY_CXT.tbl); + MY_CXT.tbl = NULL; } STATIC int indirect_endav_free(pTHX_ SV *sv, MAGIC *mg) { @@ -930,8 +933,10 @@ STATIC void indirect_teardown(pTHX_ void *root) { { dMY_CXT; ptable_free(MY_CXT.map); + MY_CXT.map = NULL; #if I_THREADSAFE ptable_hints_free(MY_CXT.tbl); + MY_CXT.tbl = NULL; #endif }