fix crash on window close (GTK)

Sat, 05 Dec 2020 10:34:10 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 05 Dec 2020 10:34:10 +0100
changeset 161
b1eac0878ce7
parent 160
b3f36bfe1b41
child 162
18892c0a9adc

fix crash on window close (GTK)

ui/gtk/text.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/text.c	Sat Dec 05 10:32:49 2020 +0100
+++ b/ui/gtk/text.c	Sat Dec 05 10:34:10 2020 +0100
@@ -574,7 +574,9 @@
 }
 
 void ui_textfield_destroy(GtkWidget *object, UiTextField *textfield) {
-    ui_destroy_boundvar(textfield->ctx, textfield->var);
+    if(textfield->var) {
+        ui_destroy_boundvar(textfield->ctx, textfield->var);
+    }
     free(textfield);
 }
 

mercurial