From 924408cf58d5aceaed742f0b613fff2bae84e863 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Fri, 22 Jul 2022 21:15:15 -0400 Subject: [PATCH] Fix crash in TGUI 9440CXI --- src/video/vid_tgui9440.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index a4fd83a0e..a95da1056 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -3150,14 +3150,16 @@ static int tgui96xx_available(void) void tgui_close(void *p) { - tgui_t *tgui = (tgui_t *)p; + tgui_t *tgui = (tgui_t *)p; - svga_close(&tgui->svga); + svga_close(&tgui->svga); + if (tgui->type >= TGUI_9440) { ddc_close(tgui->ddc); i2c_gpio_close(tgui->i2c); + }; - free(tgui); + free(tgui); } void tgui_speed_changed(void *p)