ui/common/context.c

changeset 1145
57cc5fc047f3
parent 1131
5e9bc6428bac
child 1147
30476eaff3ba
equal deleted inserted replaced
1144:6e9da0736c33 1145:57cc5fc047f3
107 } 107 }
108 108
109 void uic_context_prepare_close(UiContext *ctx) { 109 void uic_context_prepare_close(UiContext *ctx) {
110 cxListClear(ctx->states); 110 cxListClear(ctx->states);
111 cxListClear(ctx->state_widgets); 111 cxListClear(ctx->state_widgets);
112 cxListClear(ctx->action_bindings);
112 } 113 }
113 114
114 void uic_context_destroy(UiContext *ctx, void *document) { 115 void uic_context_destroy(UiContext *ctx, void *document) {
115 if(!ctx) { 116 if(!ctx) {
116 return; 117 return;
131 132
132 CxIterator i = cxListIterator(ctx->destroy_handler); 133 CxIterator i = cxListIterator(ctx->destroy_handler);
133 cx_foreach(UiDestroyHandler *, h, i) { 134 cx_foreach(UiDestroyHandler *, h, i) {
134 h->destructor(h->data); 135 h->destructor(h->data);
135 } 136 }
137
138 uic_context_detach_all(ctx);
136 139
137 cxMempoolFree(ctx->mp); 140 cxMempoolFree(ctx->mp);
138 } 141 }
139 142
140 void uic_context_attach_document(UiContext *ctx, void *document) { 143 void uic_context_attach_document(UiContext *ctx, void *document) {

mercurial