Commit e037fdf1 authored by Benjamin Berg's avatar Benjamin Berg Committed by Georges Basile Stavracas Neto

power: Handle cancelled kbd brightness proxy creation

The code must not access the passed panel if the operation to create the
keyboard proxy has been cancelled. This fixes a possible crash when
switching away from the power panel.

(cherry picked from commit 75556d7c)
parent 81dec85a
Pipeline #32351 passed with stages
in 3 minutes and 11 seconds
......@@ -1107,7 +1107,7 @@ on_kbd_property_change (GDBusProxy *proxy,
static void
got_kbd_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
CcPowerPanel *self = CC_POWER_PANEL (user_data);
CcPowerPanel *self;
g_autoptr(GError) error = NULL;
GDBusProxy *kbd_proxy;
......@@ -1119,6 +1119,7 @@ got_kbd_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
self = CC_POWER_PANEL (user_data);
self->kbd_proxy = kbd_proxy;
/* we want to change the bar if the user presses brightness buttons */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment