Merge branch 'main' into 'main'

connection: allow NULL implementation and listener in wl_closure_invoke

See merge request wayland/wayland!537
This commit is contained in:
Jie Liu 2026-04-02 13:37:22 +08:00
commit 4ba668d941

View file

@ -1232,13 +1232,16 @@ wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
implementation = target->implementation; implementation = target->implementation;
if (!implementation) { if (!implementation) {
wl_abort("Implementation of resource %d of %s is NULL\n", wl_log("Implementation of resource %d of %s is NULL\n",
target->id, target->interface->name); target->id, target->interface->name);
return wl_closure_clear_fds(closure);
} }
if (!implementation[opcode]) { if (!implementation[opcode]) {
wl_abort("listener function for opcode %u of %s is NULL\n", wl_log("listener function for opcode %u of %s is NULL\n",
opcode, target->interface->name); opcode, target->interface->name);
return wl_closure_clear_fds(closure);
} }
ffi_call(&cif, implementation[opcode], NULL, ffi_args); ffi_call(&cif, implementation[opcode], NULL, ffi_args);