]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/commitdiff
Really cleanup at thread destruction
authorVincent Pit <vince@profvince.com>
Tue, 29 Dec 2009 16:42:52 +0000 (17:42 +0100)
committerVincent Pit <vince@profvince.com>
Tue, 29 Dec 2009 16:42:52 +0000 (17:42 +0100)
Plugin.xs

index f420478a2a6f586dfa364bcaf5cbba1e4961d08b..c1272d91dcc8c66df872436175f24c6f4fc0236c 100644 (file)
--- a/Plugin.xs
+++ b/Plugin.xs
 #define __PACKAGE__     "re::engine::Plugin"
 #define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
 
+#ifndef ENTER_with_name
+# define ENTER_with_name(N) ENTER
+#endif
+
+#ifndef LEAVE_with_name
+# define LEAVE_with_name(N) LEAVE
+#endif
+
 #define REP_HAS_PERL(R, V, S) (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S))))))
 
 #ifndef REP_WORKAROUND_REQUIRE_PROPAGATION
@@ -657,6 +665,13 @@ CODE:
        MY_CXT.tbl   = t;
        MY_CXT.owner = aTHX;
     }
+    {
+       level = PerlMemShared_malloc(sizeof *level);
+       *level = 1;
+       LEAVE_with_name("sub");
+       SAVEDESTRUCTOR_X(rep_thread_cleanup, level);
+       ENTER_with_name("sub");
+    }
 
 #endif