[gnome-control-center] printers: Fix crash on close
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Fix crash on close
- Date: Tue, 30 Jun 2020 10:18:46 +0000 (UTC)
commit 99c9186fd82470c4016f5a7864ec3f1faeb74eb6
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Jun 27 11:15:02 2020 +1200
printers: Fix crash on close
It was calling g_free on an object and a warning trying to set a NULL object.
panels/printers/cc-printers-panel.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 93cd17f3f..6f18f0dd4 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -323,7 +323,8 @@ cc_printers_panel_dispose (GObject *object)
free_dests (self);
g_list_free_full (self->deleted_printers, g_free);
self->deleted_printers = NULL;
- g_object_set_data (self->reference, "self", NULL);
+ if (self->reference != NULL)
+ g_object_set_data (self->reference, "self", NULL);
g_clear_object (&self->reference);
G_OBJECT_CLASS (cc_printers_panel_parent_class)->dispose (object);
@@ -1309,7 +1310,7 @@ cc_printers_panel_init (CcPrintersPanel *self)
g_type_ensure (CC_TYPE_PERMISSION_INFOBAR);
- g_object_set_data_full (self->reference, "self", self, g_free);
+ g_object_set_data_full (self->reference, "self", self, NULL);
builder_result = gtk_builder_add_objects_from_resource (self->builder,
"/org/gnome/control-center/printers/printers.ui",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]