ui/gtk/text.c

branch
newapi
changeset 397
6d4adf6fba1f
parent 379
958bae372271
child 402
96a055be7f0b
--- a/ui/gtk/text.c	Wed Nov 27 18:54:00 2024 +0100
+++ b/ui/gtk/text.c	Thu Nov 28 18:04:55 2024 +0100
@@ -112,8 +112,8 @@
     current->container->add(current->container, scroll_area, TRUE);
     
     // bind value
-    UiText *value = var->value;
-    if(value) {
+    if(var) {
+        UiText *value = var->value;
         GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_area));
         
         if(value->value.ptr) {
@@ -165,7 +165,9 @@
 }
 
 void ui_textarea_destroy(GtkWidget *object, UiTextArea *textarea) {
-    ui_destroy_boundvar(textarea->ctx, textarea->var);
+    if(textarea->var) {
+        ui_destroy_boundvar(textarea->ctx, textarea->var);
+    }
     free(textarea);
 }
 

mercurial