Changeset 162057 in webkit
- Timestamp:
- Jan 14, 2014 11:56:42 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r162056 r162057 1 2014-01-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] UI process crashes when closing the window right after printing with javascript 4 https://bugs.webkit.org/show_bug.cgi?id=126981 5 6 Reviewed by Gustavo Noronha Silva. 7 8 The UI process crashes because when the page is closed, the web 9 view is destroyed before the print operation has actually 10 finished. Use a weak pointer to make sure the web view pointer is 11 set to NULL when the it's destroyed and emit the finished callback 12 always so that the user can clean up the operation even when the 13 web view has been closed. 14 15 * UIProcess/API/gtk/WebKitPrintOperation.cpp: 16 (drawPagesForPrintingCompleted): 17 1 18 2014-01-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
r162056 r162057 66 66 67 67 struct _WebKitPrintOperationPrivate { 68 ~_WebKitPrintOperationPrivate()69 {70 g_signal_handler_disconnect(webView, webViewDestroyedId);71 }72 73 68 WebKitWebView* webView; 74 gulong webViewDestroyedId;75 69 PrintInfo::PrintMode printMode; 76 70 … … 83 77 WEBKIT_DEFINE_TYPE(WebKitPrintOperation, webkit_print_operation, G_TYPE_OBJECT) 84 78 85 static void webViewDestroyed(GtkWidget* webView, GObject* printOperation)86 {87 g_object_unref(printOperation);88 }89 90 79 static void webkitPrintOperationConstructed(GObject* object) 91 80 { … … 96 85 G_OBJECT_CLASS(webkit_print_operation_parent_class)->constructed(object); 97 86 98 priv->webViewDestroyedId = g_signal_connect(priv->webView, "destroy", G_CALLBACK(webViewDestroyed), printOperation);87 g_object_add_weak_pointer(G_OBJECT(priv->webView), (gpointer*)&priv->webView); 99 88 } 100 89 … … 264 253 { 265 254 GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(WEBKIT_PRINT_OPERATION(context)); 266 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));267 255 268 256 // When running synchronously WebPageProxy::printFrame() calls endPrinting(). 269 if (printOperation->priv->printMode == PrintInfo::PrintModeAsync) 257 if (printOperation->priv->printMode == PrintInfo::PrintModeAsync && printOperation->priv->webView) { 258 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView)); 270 259 page->endPrinting(); 260 } 271 261 272 262 const WebCore::ResourceError& resourceError = wkPrintError ? toImpl(wkPrintError)->platformError() : WebCore::ResourceError();
Note: See TracChangeset
for help on using the changeset viewer.