From: Vincent Pit Date: Tue, 29 Dec 2009 16:42:52 +0000 (+0100) Subject: Really cleanup at thread destruction X-Git-Tag: rt66996~5 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=832243641a82325adb47027bc44a003cc66f2237;p=perl%2Fmodules%2Fre-engine-Plugin.git Really cleanup at thread destruction --- diff --git a/Plugin.xs b/Plugin.xs index f420478..c1272d9 100644 --- a/Plugin.xs +++ b/Plugin.xs @@ -11,6 +11,14 @@ #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