From 38d574697768605fbcadbed77816a16bbbe78425 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 19 Aug 2015 15:32:24 -0400 Subject: [PATCH] check compositor screen iface existence before deref in dpms fixes crash in compositors lacking screen ifaces --- src/bin/e_dpms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/e_dpms.c b/src/bin/e_dpms.c index 44f28dffa..818646483 100644 --- a/src/bin/e_dpms.c +++ b/src/bin/e_dpms.c @@ -136,7 +136,7 @@ _e_dpms_handler_desk_show_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void static Eina_Bool _e_dpms_standby(void *d EINA_UNUSED) { - if (e_comp->screen->dpms) + if (e_comp->screen && e_comp->screen->dpms) e_comp->screen->dpms(1); standby_timer = NULL; return EINA_FALSE; @@ -145,7 +145,7 @@ _e_dpms_standby(void *d EINA_UNUSED) static Eina_Bool _e_dpms_suspend(void *d EINA_UNUSED) { - if (e_comp->screen->dpms) + if (e_comp->screen && e_comp->screen->dpms) e_comp->screen->dpms(2); suspend_timer = NULL; return EINA_FALSE; @@ -154,7 +154,7 @@ _e_dpms_suspend(void *d EINA_UNUSED) static Eina_Bool _e_dpms_off(void *d EINA_UNUSED) { - if (e_comp->screen->dpms) + if (e_comp->screen && e_comp->screen->dpms) e_comp->screen->dpms(3); off_timer = NULL; return EINA_FALSE; @@ -175,7 +175,7 @@ _e_dpms_screensaver_off() E_FREE_FUNC(standby_timer, ecore_timer_del); E_FREE_FUNC(suspend_timer, ecore_timer_del); E_FREE_FUNC(off_timer, ecore_timer_del); - if (e_comp->screen->dpms) + if (e_comp->screen && e_comp->screen->dpms) e_comp->screen->dpms(0); return ECORE_CALLBACK_RENEW; }