]> Pileus Git - ~andy/gtk/commitdiff
Hold a refence on the print operation until gtk_print_job_send() is done.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 25 May 2007 17:22:55 +0000 (17:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 25 May 2007 17:22:55 +0000 (17:22 +0000)
2007-05-25  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintoperation-unix.c (unix_end_run): Hold a
        refence on the print operation until gtk_print_job_send()
        is done.  (#440040, Chris Vine)

svn path=/trunk/; revision=17915

ChangeLog
gtk/gtkprintoperation-unix.c

index 889dd36dcbf1c6ede50c4c4055865be2e239f2b1..d9f2ca9dd1c1cd8210aa5e58d52b4e10bbd0629c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-25  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation-unix.c (unix_end_run): Hold a 
+       refence on the print operation until gtk_print_job_send()
+       is done.  (#440040, Chris Vine)
+
 2007-05-25  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkiconview.c (gtk_icon_view_accessible_ref_child):
index e76313ac74498e4779efa9f959e176a75d889e64..be784380f86e1f89565996c347fd3c6c5f494d75 100644 (file)
@@ -268,9 +268,8 @@ unix_finish_send  (GtkPrintJob *job,
                    gpointer     user_data, 
                    GError      *error)
 {
-  GtkPrintOperationUnix *op_unix;
-
-  op_unix = (GtkPrintOperationUnix *) user_data;
+  GtkPrintOperation *op = (GtkPrintOperation *) user_data;
+  GtkPrintOperationUnix *op_unix = op->priv->platform_data;
 
   if (error != NULL)
     {
@@ -293,6 +292,8 @@ unix_finish_send  (GtkPrintJob *job,
 
   if (op_unix->loop)
     g_main_loop_quit (op_unix->loop);
+
+  g_object_unref (op);
 }
 
 static void
@@ -312,9 +313,12 @@ unix_end_run (GtkPrintOperation *op,
   
   /* TODO: Check for error */
   if (op_unix->job != NULL)
-    gtk_print_job_send (op_unix->job,
-                        unix_finish_send, 
-                        op_unix, NULL);
+    {
+      g_object_ref (op);
+      gtk_print_job_send (op_unix->job,
+                          unix_finish_send, 
+                          op, NULL);
+    }
 
   if (wait)
     {