Browse code

ui: fix memory leak on ui_free (fontdata was not being freed because the pointer was being mistakenly nulled a few lines before)

Dario Rodriguez authored on 01/11/2020 22:27:03
Showing 1 changed files
... ...
@@ -107,7 +107,7 @@ reui_free(reui_t *ui)
107 107
         if(ui==NULL)
108 108
                 return;
109 109
         if(ui->font!=NULL)
110
-                TTF_CloseFont(ui->font),ui->fontdata=NULL;
110
+                TTF_CloseFont(ui->font),ui->font=NULL;
111 111
         if(TTF_WasInit())
112 112
                 TTF_Quit();
113 113
         if(ui->fontdata!=NULL)