From 5ceebc02a24759c96404101dd7859632ceca174a Mon Sep 17 00:00:00 2001 From: shb Date: Tue, 11 Mar 2008 23:30:59 +0000 Subject: [PATCH] Maybe a fix to autoperl crashing Originally committed to SVN as r2024. --- aegisub/auto4_perl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aegisub/auto4_perl.cpp b/aegisub/auto4_perl.cpp index 4518fa998..a4f5fb204 100644 --- a/aegisub/auto4_perl.cpp +++ b/aegisub/auto4_perl.cpp @@ -53,7 +53,8 @@ namespace Automation4 { - + static PerlInterpreter *perl_interpreter = NULL; + /////////////////////////////////// // Perl -> C++ interface (XSUBS) // @@ -474,6 +475,7 @@ namespace Automation4 { // ...wait for it to have inited } + PERL_SET_CONTEXT(perl_interpreter); ExitCode ec = NULL; switch(type) { case CALL: @@ -500,6 +502,10 @@ namespace Automation4 { } +/////////////////////// +// PerlScriptFactory +// + PerlScriptFactory::PerlScriptFactory() { #ifdef WXTRACE_AUTOPERL @@ -538,6 +544,7 @@ namespace Automation4 { // (That was pretty magic o_O) // Let's register the perl script factory \o/ + perl_interpreter = parser; Register(this); loaded = true; }