[gnome-control-center/benzea/fix-kbd-crash: 2/2] power: Handle cancelled kbd brightness proxy creation
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/fix-kbd-crash: 2/2] power: Handle cancelled kbd brightness proxy creation
- Date: Tue, 25 Sep 2018 02:47:13 +0000 (UTC)
commit 75556d7c5af3cdff5e527409cce05e9903181fe7
Author: Benjamin Berg <bberg redhat com>
Date: Mon Sep 24 10:55:35 2018 +0200
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.
panels/power/cc-power-panel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 16dd63c9b..0020e40cf 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -1116,7 +1116,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;
@@ -1128,6 +1128,7 @@ got_kbd_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
return;
}
+ self = CC_POWER_PANEL (user_data);
self->kbd_proxy = kbd_proxy;
/* we want to change the bar if the user presses brightness buttons */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]