[gnome-control-center/benzea/fix-kbd-crash: 2/2] power: Handle cancelled kbd brightness proxy creation
- From: Benjamin Berg <bberg 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: Mon, 24 Sep 2018 08:59:26 +0000 (UTC)
commit 80b21aba43577a86bddd5285bbaac6e0a38fa605
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]