From be601764ae80a853c7bca27eb624b246ab561d4c Mon Sep 17 00:00:00 2001
From: Timo Sirainen <cras@irssi.org>
Date: Tue, 7 Aug 2001 21:03:26 +0000
Subject: [PATCH] Irssi crashed if loading script failed.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1713 dbcabf3a-b0e7-0310-adc4-f8d773084564
---
 src/perl/perl-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c
index b6fce2c1..0807fc72 100644
--- a/src/perl/perl-core.c
+++ b/src/perl/perl-core.c
@@ -230,10 +230,8 @@ static PERL_SCRIPT_REC *script_load(char *name, const char *path,
 	perl_scripts = g_slist_append(perl_scripts, script);
 	signal_emit("script created", 1, script);
 
-	if (!perl_script_eval(script)) {
-		perl_script_unload(script);
-                script = NULL;
-	}
+	if (!perl_script_eval(script))
+                script = NULL; /* the script is destroyed in "script error" signal */
         return script;
 }