diff -r d188f52cff7f -r 70305d427f25 ui/common/context.c --- a/ui/common/context.c Wed Oct 23 17:16:51 2024 +0200 +++ b/ui/common/context.c Fri Oct 25 15:37:02 2024 +0200 @@ -209,7 +209,7 @@ UiVar* uic_create_value_var(UiContext* ctx, void* value) { UiVar *var = (UiVar*)ui_malloc(ctx, sizeof(UiVar)); var->from = NULL; - var->from_ctx = NULL; + var->from_ctx = ctx; var->value = value; var->type = UI_VAR_SPECIAL; return var; @@ -563,7 +563,7 @@ } void ui_free(UiContext *ctx, void *ptr) { - if(ctx) { + if(ctx && ptr) { cxFree(ctx->allocator, ptr); } }