]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - indirect.xs
Nullify thread local storage entries when they are freed
[perl/modules/indirect.git] / indirect.xs
index db563796e6ce7681e03aabfafd9bd516c66c4cdd..5cd420cb31f7897649bde1324dec1ea1d98706c6 100644 (file)
@@ -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
  }