diff dwtest.c @ 2816:4521f014bb17

Fix some memory leaks reported by Xcode's Instruments.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 01 Aug 2022 22:46:31 +0000
parents 56eab3a84b62
children 455d539ac555
line wrap: on
line diff
--- a/dwtest.c	Mon Aug 01 22:09:46 2022 +0000
+++ b/dwtest.c	Mon Aug 01 22:46:31 2022 +0000
@@ -1235,6 +1235,8 @@
         dw_pixmap_set_transparent_color(image, DW_CLR_WHITE);
 
     dw_messagebox(utf8string ? utf8string : "DWTest", DW_MB_OK|DW_MB_INFORMATION, "Width: %d Height: %d\n", font_width, font_height);
+    if(utf8string)
+        dw_free(utf8string);
     dw_draw_rect(0, text1pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*width1, font_height*rows);
     dw_draw_rect(0, text2pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*cols, font_height*rows);
     dw_signal_connect(textbox1, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(context_menu_event), NULL);