From d2dc0956ea6f382092c11a405abc8b9cf485439c Mon Sep 17 00:00:00 2001 From: norayr Date: Wed, 24 May 2017 13:02:21 +0400 Subject: [PATCH] finalize on error as well. --- IRC.Mod | 3 +-- test.Mod | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IRC.Mod b/IRC.Mod index 2c749d9..81fd9da 100644 --- a/IRC.Mod +++ b/IRC.Mod @@ -474,7 +474,6 @@ VAR b: BOOLEAN; msg: ARRAY 23 OF CHAR; BEGIN - Out.String("interrupt caught."); Out.Ln; IF inst.doLog THEN i := 0; REPEAT @@ -618,7 +617,7 @@ BEGIN Pong(inst, text); END; IF error(text) THEN - Disconnect(inst); + finalize(inst); b := FALSE; ELSE IF isServerMsg(text) THEN (* string starts with ':' *) diff --git a/test.Mod b/test.Mod index 033606a..8ba4b8e 100644 --- a/test.Mod +++ b/test.Mod @@ -58,6 +58,7 @@ END onPublicMessageWithMention; PROCEDURE interrupt(i: LONGINT); BEGIN (* here we need to flush files to disk before exiting. and probably close the irc connection *) + Out.String("interrupt caught."); Out.Ln; IRC.finalize(inst); HALT(0); END interrupt;