Skip to content

Commit c7a905e

Browse files
bl4kravenacassis
authored andcommitted
apps/system/vi: Add missing vi_release before exit.
If VI exit without vi_release, that broken console. Signed-off-by: Leo Chung <gewalalb@gmail.com>
1 parent c0e04b0 commit c7a905e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

system/vi/vi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ static void vi_write(FAR struct vi_s *vi, FAR const char *buffer,
559559
{
560560
fprintf(stderr, "ERROR: write to stdout failed: %d\n",
561561
errcode);
562+
vi_release(vi);
562563
exit(EXIT_FAILURE);
563564
}
564565
}
@@ -635,6 +636,7 @@ static int vi_getch(FAR struct vi_s *vi)
635636
{
636637
fprintf(stderr, "ERROR: read from stdin failed: %d\n",
637638
errcode);
639+
vi_release(vi);
638640
exit(EXIT_FAILURE);
639641
}
640642
}

0 commit comments

Comments
 (0)