summaryrefslogtreecommitdiff
path: root/compositor/cms-static.c
diff options
context:
space:
mode:
Diffstat (limited to 'compositor/cms-static.c')
-rw-r--r--compositor/cms-static.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/compositor/cms-static.c b/compositor/cms-static.c
index 2f357c41..540d6ad3 100644
--- a/compositor/cms-static.c
+++ b/compositor/cms-static.c
@@ -105,8 +105,13 @@ wet_module_init(struct weston_compositor *ec,
return -1;
cms->ec = ec;
- cms->destroy_listener.notify = cms_notifier_destroy;
- wl_signal_add(&ec->destroy_signal, &cms->destroy_listener);
+
+ if (!weston_compositor_add_destroy_listener_once(ec,
+ &cms->destroy_listener,
+ cms_notifier_destroy)) {
+ free(cms);
+ return 0;
+ }
cms->output_created_listener.notify = cms_notifier_output_created;
wl_signal_add(&ec->output_created_signal, &cms->output_created_listener);