ui/common/document.c

branch
newapi
changeset 342
99f83fbf48e9
parent 232
e2b33055113f
--- a/ui/common/document.c	Sun Oct 20 21:26:06 2024 +0200
+++ b/ui/common/document.c	Mon Oct 21 15:47:10 2024 +0200
@@ -96,7 +96,20 @@
 }
 
 void ui_document_destroy(void *doc) {
-    // TODO
+    UiContext *ctx = ui_document_context(doc);
+    if(ctx) {
+        UiEvent ev;
+        ev.window = NULL;
+        ev.document = doc;
+        ev.obj = NULL;
+        ev.eventdata = NULL;
+        ev.intval = 0;
+
+        if(ctx->close_callback) {
+            ctx->close_callback(&ev, ctx->close_data);
+        }
+        cxMempoolDestroy(ctx->mp);
+    }
 }
 
 UiContext* ui_document_context(void *doc) {

mercurial