finalize on error as well.

This commit is contained in:
norayr 2017-05-24 13:02:21 +04:00
parent 0edfd99ca4
commit d2dc0956ea
2 changed files with 2 additions and 2 deletions

View file

@ -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 ':' *)

View file

@ -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;