e backlight - avoid seg when comp is shut down and backlight updated

if comp is already shut down, then backlight can't do shutdown things
assuming comp is around, thus handle null e_comp. this fixes segv's
waiting to happen as backlight is shut down after comp and thus e_comp
is a garbage pointer of course

@fix
This commit is contained in:
Carsten Haitzler 2015-12-07 19:39:01 +09:00
parent 027b044297
commit 47f26b5b08
1 changed files with 2 additions and 0 deletions

View File

@ -210,6 +210,7 @@ _e_backlight_update(void)
Ecore_X_Randr_Output *out;
int i, num = 0;
if (!e_comp) return;
root = e_comp->root;
// try randr
if (root && xbl_avail)
@ -278,6 +279,7 @@ _e_backlight_set(double val)
int num = 0, i;
char *name;
if (!e_comp) return;
root = e_comp->root;
out = ecore_x_randr_window_outputs_get(root, &num);
if ((out) && (num > 0))