From bffe879db8a6f53d7f74acbed4c162cab1bca409 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 5 Nov 2008 12:36:17 +0100 Subject: Fix crash in weechat_perl_exec() after unloading a Perl script --- src/plugins/scripts/perl/weechat-perl.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/plugins/scripts/perl/weechat-perl.c') diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 67df60742..6af4cfafc 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -117,7 +117,8 @@ weechat_perl_exec (struct t_plugin_script *script, void *ret_value; int *ret_i, mem_err, length; SV *ret_s; - struct t_plugin_script *old_perl_current_script; + + perl_current_script = script; /* this code is placed here to conform ISO C90 */ dSP; @@ -138,12 +139,6 @@ weechat_perl_exec (struct t_plugin_script *script, SAVETMPS; PUSHMARK(sp); - old_perl_current_script = perl_current_script; - - /* are we loading the script file ? */ - if (strcmp (function, "weechat_perl_load_eval_file") != 0) - perl_current_script = script; - count = perl_call_argv (func, G_EVAL | G_SCALAR, argv); ret_value = NULL; mem_err = 1; @@ -213,15 +208,6 @@ weechat_perl_exec (struct t_plugin_script *script, weechat_prefix ("error"), PERL_PLUGIN_NAME, function); return NULL; } - - if (strcmp (function, "weechat_perl_load_eval_file") != 0) - { - perl_current_script = old_perl_current_script; -#ifdef MULTIPLICITY - if (perl_current_script) - PERL_SET_CONTEXT (perl_current_script->interpreter); -#endif - } return ret_value; } -- cgit v1.2.3