# HG changeset patch # User Olaf Wintermann # Date 1732813495 -3600 # Node ID 6d4adf6fba1f7055fca90a56ab0f0c30d8baadee # Parent 4cb2160854792fe82818f835af4522b6dffd8db4 fix textarea crash when no value is specified (GTK) diff -r 4cb216085479 -r 6d4adf6fba1f ui/gtk/text.c --- 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); }