1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Merge pull request #543 from LemonBoy/script-error-message

Make sure to make a copy of ERRSV content.
This commit is contained in:
ailin-nemui 2016-09-13 23:27:43 +02:00 committed by GitHub
commit ae5e4a94da
2 changed files with 7 additions and 2 deletions

View File

@ -85,7 +85,9 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
script_unregister_expandos(script); script_unregister_expandos(script);
/* rec has been freed now */ /* rec has been freed now */
signal_emit("script error", 2, script, SvPV_nolen(ERRSV)); char *error = g_strdup(SvPV_nolen(ERRSV));
signal_emit("script error", 2, script, error);
g_free(error);
} else if (retcount > 0) { } else if (retcount > 0) {
ret = g_strdup(POPp); ret = g_strdup(POPp);
*free_ret = TRUE; *free_ret = TRUE;

View File

@ -77,7 +77,10 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
/* make sure we don't get back here */ /* make sure we don't get back here */
script_unregister_statusbars(script); script_unregister_statusbars(script);
} }
signal_emit("script error", 2, script, SvPV_nolen(ERRSV));
char *error = g_strdup(SvPV_nolen(ERRSV));
signal_emit("script error", 2, script, error);
g_free(error);
} else { } else {
/* min_size and max_size can be changed, move them to SBAR_ITEM_REC */ /* min_size and max_size can be changed, move them to SBAR_ITEM_REC */
hv = hvref(item_sv); hv = hvref(item_sv);