It doesn't always happen, but it can be easily reproduced running test /webkit2/WebKitPrintOperation/close-after-print $ Programs/TestWebKitAPI/WebKit2Gtk/TestPrinting -p /webkit2/WebKitPrintOperation/close-after-print /webkit2/WebKitPrintOperation/close-after-print: OK pure virtual method called terminate called without an active exception This happens because the page is closed when the pages have been printed, but print job is still ongoing sending the data to the printer. When print job finishes, we try to notify the UI process sending the print callback message using WebPage::send(), but the web page object has been destroyed. The virtual method it complains about is probably MessageSender::messageSenderDestinationID() used by send(). Since our print operation is always asynchronous, we need a way to notify the web page when the print operation has actually finished to clean it up, but also notify the print operation when the page has been closed to not try to notify the UI process in that case.
Created attachment 226099 [details] Patch
Comment on attachment 226099 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226099&action=review GTK+ bits look good to me. I'll leave the rest to the WebKit2 owners. > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:418 > +void WebPrintOperationGtk::disconnectFromPage() Maybe call this didDisconnectFromPage or notifyDisconnectFromPage since the disconnection actually happens earlier?
(In reply to comment #2) > (From update of attachment 226099 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=226099&action=review > > GTK+ bits look good to me. I'll leave the rest to the WebKit2 owners. Thanks for the review. > > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:418 > > +void WebPrintOperationGtk::disconnectFromPage() > > Maybe call this didDisconnectFromPage or notifyDisconnectFromPage since the disconnection actually happens earlier? I followed other similar existing methods that are disconnectFromPage. This happens when the page is closed, and is telling the print operation to disconnect from the page. It's consistent with WebColorChooser::disconnectFromPage(), WebPopupMenu::disconnectFromPage(), WebOpenPanelResultListener::disconnectFromPage(), etc.
Committed r165489: <http://trac.webkit.org/changeset/165489>