Title: [108040] trunk/Source/WebKit2
Revision
108040
Author
[email protected]
Date
2012-02-16 23:26:13 -0800 (Thu, 16 Feb 2012)

Log Message

[GTK] Make sure print operation object is alive until printing finishes in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=78829

Reviewed by Martin Robinson.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted): Adopt the WebKitPrintOperation
reference so that it's released when the callback finishes.
(webkitPrintOperationRunDialogForFrame): Pass a reference of
WebKitPrintOperation to the printing callback.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (108039 => 108040)


--- trunk/Source/WebKit2/ChangeLog	2012-02-17 07:23:28 UTC (rev 108039)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-17 07:26:13 UTC (rev 108040)
@@ -1,3 +1,16 @@
+2012-02-16  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Make sure print operation object is alive until printing finishes in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=78829
+
+        Reviewed by Martin Robinson.
+
+        * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+        (drawPagesForPrintingCompleted): Adopt the WebKitPrintOperation
+        reference so that it's released when the callback finishes.
+        (webkitPrintOperationRunDialogForFrame): Pass a reference of
+        WebKitPrintOperation to the printing callback.
+
 2012-02-15  Geoffrey Garen  <[email protected]>
 
         Made Weak<T> single-owner, adding PassWeak<T>

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp (108039 => 108040)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp	2012-02-17 07:23:28 UTC (rev 108039)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp	2012-02-17 07:26:13 UTC (rev 108040)
@@ -234,10 +234,10 @@
 
 static void drawPagesForPrintingCompleted(WKErrorRef, void* context)
 {
-    WebKitPrintOperation* printOperation = WEBKIT_PRINT_OPERATION(context);
+    GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(WEBKIT_PRINT_OPERATION(context));
     WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
     page->endPrinting();
-    g_signal_emit(printOperation, signals[DONE], 0, NULL);
+    g_signal_emit(printOperation.get(), signals[DONE], 0, NULL);
 }
 
 void webkitPrintOperationRunDialogForFrame(WebKitPrintOperation* printOperation, GtkWindow* parent, WebFrameProxy* webFrame)
@@ -262,7 +262,7 @@
 
     PrintInfo printInfo(priv->printSettings.get(), priv->pageSetup.get());
     WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(priv->webView));
-    page->drawPagesForPrinting(webFrame, printInfo, VoidCallback::create(printOperation, &drawPagesForPrintingCompleted));
+    page->drawPagesForPrinting(webFrame, printInfo, VoidCallback::create(g_object_ref(printOperation), &drawPagesForPrintingCompleted));
 }
 
 /**
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to