mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Fix bug with callbacks when loading a script already loaded
This commit is contained in:
@@ -76,6 +76,7 @@ XS (XS_weechat_api_register)
|
||||
(void) cv;
|
||||
|
||||
perl_current_script = NULL;
|
||||
perl_registered_script = NULL;
|
||||
|
||||
if (items < 7)
|
||||
{
|
||||
@@ -111,6 +112,7 @@ XS (XS_weechat_api_register)
|
||||
description, shutdown_func, charset);
|
||||
if (perl_current_script)
|
||||
{
|
||||
perl_registered_script = perl_current_script;
|
||||
if ((weechat_perl_plugin->debug >= 1) || !perl_quiet)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
|
||||
@@ -43,6 +43,7 @@ int perl_quiet = 0;
|
||||
struct t_plugin_script *perl_scripts = NULL;
|
||||
struct t_plugin_script *last_perl_script = NULL;
|
||||
struct t_plugin_script *perl_current_script = NULL;
|
||||
struct t_plugin_script *perl_registered_script = NULL;
|
||||
const char *perl_current_script_filename = NULL;
|
||||
int perl_quit_or_upgrade = 0;
|
||||
|
||||
@@ -221,8 +222,7 @@ weechat_perl_exec (struct t_plugin_script *script,
|
||||
FREETMPS;
|
||||
LEAVE;
|
||||
|
||||
if (old_perl_current_script)
|
||||
perl_current_script = old_perl_current_script;
|
||||
perl_current_script = old_perl_current_script;
|
||||
#ifdef MULTIPLICITY
|
||||
PERL_SET_CONTEXT (old_context);
|
||||
#else
|
||||
@@ -286,6 +286,7 @@ weechat_perl_load (const char *filename)
|
||||
}
|
||||
|
||||
perl_current_script = NULL;
|
||||
perl_registered_script = NULL;
|
||||
|
||||
#ifdef MULTIPLICITY
|
||||
perl_current_interpreter = perl_alloc();
|
||||
@@ -386,8 +387,8 @@ weechat_perl_load (const char *filename)
|
||||
}
|
||||
|
||||
free (eval);
|
||||
|
||||
if (!perl_current_script)
|
||||
|
||||
if (!perl_registered_script)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"register\" not "
|
||||
@@ -399,7 +400,8 @@ weechat_perl_load (const char *filename)
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
perl_current_script = perl_registered_script;
|
||||
|
||||
#ifdef MULTIPLICITY
|
||||
perl_current_script->interpreter = (PerlInterpreter *)perl_current_interpreter;
|
||||
#else
|
||||
|
||||
@@ -31,6 +31,7 @@ extern int perl_quiet;
|
||||
extern struct t_plugin_script *perl_scripts;
|
||||
extern struct t_plugin_script *last_perl_script;
|
||||
extern struct t_plugin_script *perl_current_script;
|
||||
extern struct t_plugin_script *perl_registered_script;
|
||||
extern const char *perl_current_script_filename;
|
||||
|
||||
extern void *weechat_perl_exec (struct t_plugin_script *script,
|
||||
|
||||
Reference in New Issue
Block a user