summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2012-03-12 12:36:50 +0100
committerMarek Kasik <mkasik@redhat.com>2012-03-12 12:36:50 +0100
commitabf1c57bd0e472eedbd174210d935a1c3ad01a6d (patch)
treee5b9e6dc8554d4836f2190e9ad4507b7024fff6b
parent943c873364f3dd7552bc66353c0cdf133bb9b4f6 (diff)
downloadgtk+-abf1c57bd0e472eedbd174210d935a1c3ad01a6d.tar.gz
printing: Increase reference count for user data
Increase reference count for data passed to colord's callbacks (#671419).
-rw-r--r--modules/printbackends/cups/gtkprintercups.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/printbackends/cups/gtkprintercups.c b/modules/printbackends/cups/gtkprintercups.c
index 154b23fcfc..e8c652f426 100644
--- a/modules/printbackends/cups/gtkprintercups.c
+++ b/modules/printbackends/cups/gtkprintercups.c
@@ -276,6 +276,8 @@ colord_client_profile_connect_cb (GObject *source_object,
/* update the UI */
colord_update_ui_from_settings (printer);
+
+ g_object_unref (printer);
}
static void
@@ -303,10 +305,12 @@ colord_client_device_get_profile_for_qualifiers_cb (GObject *source_object,
cd_profile_connect (printer->colord_profile,
printer->colord_cancellable,
colord_client_profile_connect_cb,
- printer);
+ g_object_ref (printer));
out:
/* update the UI */
colord_update_ui_from_settings (printer);
+
+ g_object_unref (printer);
}
void
@@ -364,7 +368,7 @@ gtk_printer_cups_update_settings (GtkPrinterCups *printer,
(const gchar **) qualifiers,
printer->colord_cancellable,
colord_client_device_get_profile_for_qualifiers_cb,
- printer);
+ g_object_ref (printer));
/* save for the future */
g_free (printer->colord_qualifier);
@@ -398,6 +402,8 @@ colord_client_device_connect_cb (GObject *source_object,
out:
/* update the UI */
colord_update_ui_from_settings (printer);
+
+ g_object_unref (printer);
}
static void
@@ -425,10 +431,12 @@ colord_client_find_device_cb (GObject *source_object,
cd_device_connect (printer->colord_device,
printer->colord_cancellable,
colord_client_device_connect_cb,
- printer);
+ g_object_ref (printer));
out:
/* update the UI */
colord_update_ui_from_settings (printer);
+
+ g_object_unref (printer);
}
static void
@@ -466,7 +474,7 @@ colord_update_device (GtkPrinterCups *printer)
colord_device_id,
printer->colord_cancellable,
colord_client_find_device_cb,
- printer);
+ g_object_ref (printer));
out:
g_free (colord_device_id);
@@ -493,6 +501,8 @@ colord_client_connect_cb (GObject *source_object,
/* refresh the device */
colord_update_device (printer);
+
+ g_object_unref (printer);
}
#endif
@@ -537,7 +547,7 @@ gtk_printer_cups_new (const char *name,
cd_client_connect (printer->colord_client,
printer->colord_cancellable,
colord_client_connect_cb,
- printer);
+ g_object_ref (printer));
}
#endif
return printer;