ui/common/context.c

changeset 440
7c4b9cba09ca
parent 420
28a5920bebe0
equal deleted inserted replaced
439:bf7084544cb1 440:7c4b9cba09ca
162 i = cxListIterator(ls); 162 i = cxListIterator(ls);
163 cx_foreach(void *, doc, i) { 163 cx_foreach(void *, doc, i) {
164 ctx->detach_document2(ctx, doc); 164 ctx->detach_document2(ctx, doc);
165 } 165 }
166 166
167 cxListDestroy(ls); 167 cxListFree(ls);
168 } 168 }
169 169
170 static UiVar* ctx_getvar(UiContext *ctx, CxHashKey key) { 170 static UiVar* ctx_getvar(UiContext *ctx, CxHashKey key) {
171 UiVar *var = cxMapGet(ctx->vars, key); 171 UiVar *var = cxMapGet(ctx->vars, key);
172 if(!var && ctx->documents) { 172 if(!var && ctx->documents) {
464 ctx->close_callback = fnc; 464 ctx->close_callback = fnc;
465 ctx->close_data = udata; 465 ctx->close_data = udata;
466 } 466 }
467 467
468 UIEXPORT void ui_context_destroy(UiContext *ctx) { 468 UIEXPORT void ui_context_destroy(UiContext *ctx) {
469 cxMempoolDestroy(ctx->mp); 469 cxMempoolFree(ctx->mp);
470 } 470 }
471 471
472 472
473 void ui_set_group(UiContext *ctx, int group) { 473 void ui_set_group(UiContext *ctx, int group) {
474 if(cxListFind(ctx->groups, &group) == -1) { 474 if(cxListFind(ctx->groups, &group) == -1) {
533 } 533 }
534 va_end(ap); 534 va_end(ap);
535 535
536 uic_add_group_widget(ctx, widget, enable, groups); 536 uic_add_group_widget(ctx, widget, enable, groups);
537 537
538 cxListDestroy(groups); 538 cxListFree(groups);
539 } 539 }
540 540
541 size_t uic_group_array_size(const int *groups) { 541 size_t uic_group_array_size(const int *groups) {
542 int i; 542 int i;
543 for(i=0;groups[i] >= 0;i++) { } 543 for(i=0;groups[i] >= 0;i++) { }

mercurial