shithub: m8c

Download patch

ref: 8affe34c064bb426b8d61581a7577be0e996805c
parent: c2a3c82f4056af95aaa0e420d74a9c39f0329ca6
author: Maido Käära <maido@producement.com>
date: Sun Feb 5 16:51:56 EST 2023

Clean up font and slip buffer

In Android when we quit m8c and start it again it does not start
from a clean slate so we need a bit more cleanup for it to work properly.

--- a/main.c
+++ b/main.c
@@ -14,6 +14,7 @@
 #include "render.h"
 #include "serial.h"
 #include "slip.h"
+#include "SDL2_inprint.h"
 
 enum state { QUIT, WAIT_FOR_DEVICE, RUN };
 
@@ -40,6 +41,8 @@
 
   static uint8_t slip_buffer[serial_read_size]; // SLIP command buffer
 
+  SDL_zero(slip_buffer);
+
   // settings for the slip packet handler
   static const slip_descriptor_s slip_descriptor = {
       .buf = slip_buffer,
@@ -250,6 +253,7 @@
   close_renderer();
   close_serial_port();
   free(serial_buf);
+  kill_inline_font();
   SDL_Quit();
   return 0;
 }
--