mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-17 22:05:56 -05:00
Assert (almost all) signals have no attached listeners on destroy
This commit is contained in:
parent
b03b05d2b3
commit
8f56f7ca43
79 changed files with 518 additions and 9 deletions
|
|
@ -28,6 +28,7 @@ void wlr_allocator_init(struct wlr_allocator *alloc,
|
|||
.impl = impl,
|
||||
.buffer_caps = buffer_caps,
|
||||
};
|
||||
|
||||
wl_signal_init(&alloc->events.destroy);
|
||||
}
|
||||
|
||||
|
|
@ -173,6 +174,9 @@ void wlr_allocator_destroy(struct wlr_allocator *alloc) {
|
|||
return;
|
||||
}
|
||||
wl_signal_emit_mutable(&alloc->events.destroy, NULL);
|
||||
|
||||
assert(wl_list_empty(&alloc->events.destroy.listener_list));
|
||||
|
||||
alloc->impl->destroy(alloc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,7 +241,8 @@ bool wlr_drm_syncobj_timeline_waiter_init(struct wlr_drm_syncobj_timeline_waiter
|
|||
}
|
||||
|
||||
void wlr_drm_syncobj_timeline_waiter_finish(struct wlr_drm_syncobj_timeline_waiter *waiter) {
|
||||
wl_list_remove(&waiter->events.ready.listener_list);
|
||||
assert(wl_list_empty(&waiter->events.ready.listener_list));
|
||||
|
||||
wl_event_source_remove(waiter->event_source);
|
||||
close(waiter->ev_fd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,9 @@ void wlr_renderer_destroy(struct wlr_renderer *r) {
|
|||
|
||||
wl_signal_emit_mutable(&r->events.destroy, r);
|
||||
|
||||
assert(wl_list_empty(&r->events.destroy.listener_list));
|
||||
assert(wl_list_empty(&r->events.lost.listener_list));
|
||||
|
||||
if (r->impl && r->impl->destroy) {
|
||||
r->impl->destroy(r);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue