From: Vincent Pit Date: Sat, 4 Oct 2014 15:39:24 +0000 (+0200) Subject: Nullify thread local storage entries when they are freed X-Git-Tag: v0.13~6 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4a34c3bc9a4f33d96ad7488478c0f1e7ac10bce1;p=perl%2Fmodules%2Fautovivification.git Nullify thread local storage entries when they are freed This makes possible problems easier to reproduce. --- diff --git a/autovivification.xs b/autovivification.xs index d92b0b7..bc6857e 100644 --- a/autovivification.xs +++ b/autovivification.xs @@ -215,8 +215,10 @@ STATIC void a_thread_cleanup(pTHX_ void *ud) { #if A_WORKAROUND_REQUIRE_PROPAGATION ptable_hints_free(MY_CXT.tbl); + MY_CXT.tbl = NULL; #endif /* A_WORKAROUND_REQUIRE_PROPAGATION */ ptable_seen_free(MY_CXT.seen); + MY_CXT.seen = NULL; } STATIC int a_endav_free(pTHX_ SV *sv, MAGIC *mg) { @@ -1128,8 +1130,10 @@ STATIC void a_teardown(pTHX_ void *root) { dMY_CXT; # if A_THREADSAFE && A_WORKAROUND_REQUIRE_PROPAGATION ptable_hints_free(MY_CXT.tbl); + MY_CXT.tbl = NULL; # endif /* A_THREADSAFE && A_WORKAROUND_REQUIRE_PROPAGATION */ ptable_seen_free(MY_CXT.seen); + MY_CXT.seen = NULL; } a_ck_restore(OP_PADANY, &a_old_ck_padany);