gtk+ r20186 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20186 - in trunk: . gtk
- Date: Tue, 27 May 2008 04:48:31 +0000 (UTC)
Author: matthiasc
Date: Tue May 27 04:48:31 2008
New Revision: 20186
URL: http://svn.gnome.org/viewvc/gtk+?rev=20186&view=rev
Log:
Bug 531008 â Crash in gtkprintunixdialog.c
* gtk/gtkprintunixdialog.c: Disconnect signal handlers when
the dialog closes. Patch by Yevgen Muntyan.
Modified:
trunk/ChangeLog
trunk/gtk/gtkprintunixdialog.c
Modified: trunk/gtk/gtkprintunixdialog.c
==============================================================================
--- trunk/gtk/gtkprintunixdialog.c (original)
+++ trunk/gtk/gtkprintunixdialog.c Tue May 27 04:48:31 2008
@@ -195,6 +195,7 @@
GList *print_backends;
GtkPrinter *current_printer;
+ GtkPrinter *request_details_printer;
guint request_details_tag;
GtkPrinterOptionSet *options;
gulong options_changed_handler;
@@ -450,6 +451,21 @@
}
static void
+disconnect_printer_details_request (GtkPrintUnixDialog *dialog)
+{
+ GtkPrintUnixDialogPrivate *priv = dialog->priv;
+
+ if (priv->request_details_tag)
+ {
+ g_signal_handler_disconnect (priv->request_details_printer,
+ priv->request_details_tag);
+ priv->request_details_tag = 0;
+ g_object_unref (priv->request_details_printer);
+ priv->request_details_printer = NULL;
+ }
+}
+
+static void
gtk_print_unix_dialog_finalize (GObject *object)
{
GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (object);
@@ -458,13 +474,8 @@
GList *node;
unschedule_idle_mark_conflicts (dialog);
+ disconnect_printer_details_request (dialog);
- if (priv->request_details_tag)
- {
- g_source_remove (priv->request_details_tag);
- priv->request_details_tag = 0;
- }
-
if (priv->current_printer)
{
g_object_unref (priv->current_printer);
@@ -1358,7 +1369,7 @@
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
- priv->request_details_tag = 0;
+ disconnect_printer_details_request (dialog);
if (success)
{
@@ -1385,13 +1396,9 @@
g_free (priv->waiting_for_printer);
priv->waiting_for_printer = NULL;
}
-
- if (priv->request_details_tag)
- {
- g_source_remove (priv->request_details_tag);
- priv->request_details_tag = 0;
- }
-
+
+ disconnect_printer_details_request (dialog);
+
printer = NULL;
if (gtk_tree_selection_get_selected (selection, NULL, &filter_iter))
{
@@ -1410,8 +1417,9 @@
priv->request_details_tag =
g_signal_connect (printer, "details-acquired",
G_CALLBACK (printer_details_acquired), dialog);
+ /* take the reference */
+ priv->request_details_printer = printer;
gtk_printer_request_details (printer);
- g_object_unref (printer);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]