fix potential crash in menuitem_list_remove_binding

7 days ago

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 06 Apr 2025 14:11:43 +0200 (7 days ago)
changeset 558
62aefa91ffc5
parent 557
e6415fd4af4b
child 559
dc5ed4c10d83

fix potential crash in menuitem_list_remove_binding

ui/gtk/menu.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/menu.c	Sun Apr 06 14:10:04 2025 +0200
+++ b/ui/gtk/menu.c	Sun Apr 06 14:11:43 2025 +0200
@@ -281,7 +281,7 @@
         cxListAdd(bindings, ls);
         
         // The destruction of the toplevel obj must remove the menulist binding
-        cxMempoolRegister(obj->ctx->mp, ls, menuitem_list_remove_binding);
+        uic_context_add_destructor(obj->ctx, menuitem_list_remove_binding, ls);
         
         ui_update_menuitem_list(ls);
     }
@@ -595,7 +595,7 @@
         cxListAdd(bindings, ls);
         
         // The destruction of the toplevel obj must remove the menulist binding
-        cxMempoolRegister(obj->ctx->mp, ls, menuitem_list_remove_binding);
+        uic_context_add_destructor(obj->ctx, menuitem_list_remove_binding, ls);
         
         ui_update_gmenu_item_list(ls);
     }

mercurial