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; b: BOOLEAN;
msg: ARRAY 23 OF CHAR; msg: ARRAY 23 OF CHAR;
BEGIN BEGIN
Out.String("interrupt caught."); Out.Ln;
IF inst.doLog THEN IF inst.doLog THEN
i := 0; i := 0;
REPEAT REPEAT
@ -618,7 +617,7 @@ BEGIN
Pong(inst, text); Pong(inst, text);
END; END;
IF error(text) THEN IF error(text) THEN
Disconnect(inst); finalize(inst);
b := FALSE; b := FALSE;
ELSE ELSE
IF isServerMsg(text) THEN (* string starts with ':' *) IF isServerMsg(text) THEN (* string starts with ':' *)

View file

@ -58,6 +58,7 @@ END onPublicMessageWithMention;
PROCEDURE interrupt(i: LONGINT); PROCEDURE interrupt(i: LONGINT);
BEGIN BEGIN
(* here we need to flush files to disk before exiting. and probably close the irc connection *) (* 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); IRC.finalize(inst);
HALT(0); HALT(0);
END interrupt; END interrupt;