aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2022-05-16 20:35:31 +0300
committerSimon Ser <contact@emersion.fr>2022-05-23 11:11:38 +0000
commit4ac19e9f9cf38bc146ba42cc7ce89b29e748b30f (patch)
treebf9e104f9dbff02aa863140991edb7d2422fea29
parentcde3700386cc967a9c0805a07310b35e56974440 (diff)
util/addon: avoid calling finish() twice
No functional change.
-rw-r--r--include/wlr/util/addon.h5
-rw-r--r--util/addon.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/include/wlr/util/addon.h b/include/wlr/util/addon.h
index 382252ae..c64200cf 100644
--- a/include/wlr/util/addon.h
+++ b/include/wlr/util/addon.h
@@ -20,6 +20,7 @@ struct wlr_addon;
struct wlr_addon_interface {
const char *name;
+ // Has to call wlr_addon_finish()
void (*destroy)(struct wlr_addon *addon);
};
@@ -34,10 +35,10 @@ void wlr_addon_set_init(struct wlr_addon_set *set);
void wlr_addon_set_finish(struct wlr_addon_set *set);
void wlr_addon_init(struct wlr_addon *addon, struct wlr_addon_set *set,
- const void *owner, const struct wlr_addon_interface *impl);
+ const void *owner, const struct wlr_addon_interface *impl);
void wlr_addon_finish(struct wlr_addon *addon);
struct wlr_addon *wlr_addon_find(struct wlr_addon_set *set, const void *owner,
- const struct wlr_addon_interface *impl);
+ const struct wlr_addon_interface *impl);
#endif
diff --git a/util/addon.c b/util/addon.c
index c9b373a7..10aed744 100644
--- a/util/addon.c
+++ b/util/addon.c
@@ -12,7 +12,6 @@ void wlr_addon_set_init(struct wlr_addon_set *set) {
void wlr_addon_set_finish(struct wlr_addon_set *set) {
struct wlr_addon *addon, *tmp;
wl_list_for_each_safe(addon, tmp, &set->addons, link) {
- wlr_addon_finish(addon);
addon->impl->destroy(addon);
}
}
@@ -34,7 +33,6 @@ void wlr_addon_init(struct wlr_addon *addon, struct wlr_addon_set *set,
void wlr_addon_finish(struct wlr_addon *addon) {
wl_list_remove(&addon->link);
- wl_list_init(&addon->link);
}
struct wlr_addon *wlr_addon_find(struct wlr_addon_set *set, const void *owner,