Changeset 59378 in webkit


Ignore:
Timestamp:
May 13, 2010 11:59:08 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

[Qt] REGRESSION(r58497) tst_QGraphicsWebView::crashOnViewlessWebPages() is failing
https://bugs.webkit.org/show_bug.cgi?id=38655

Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> on 2010-05-11
Reviewed by Laszlo Gombos.

Fix double free by moving the connect till after the resize.

The bug is causes by the fact that a resize of an empty page causes a
layout, thus deleting the qgraphicswebview before setHtml is called,
which then deletes it again, causing a double free.

  • tests/qgraphicswebview/tst_qgraphicswebview.cpp:

(tst_QGraphicsWebView::crashOnViewlessWebPages):

Location:
trunk/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/ChangeLog

    r59377 r59378  
     12010-05-11  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Laszlo Gombos.
     4
     5        [Qt] REGRESSION(r58497) tst_QGraphicsWebView::crashOnViewlessWebPages() is failing
     6        https://bugs.webkit.org/show_bug.cgi?id=38655
     7
     8        Fix double free by moving the connect till after the resize.
     9
     10        The bug is causes by the fact that a resize of an empty page causes a
     11        layout, thus deleting the qgraphicswebview before setHtml is called,
     12        which then deletes it again, causing a double free.
     13
     14        * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
     15        (tst_QGraphicsWebView::crashOnViewlessWebPages):
     16
    1172010-05-12  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    218
  • trunk/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp

    r58141 r59378  
    8585    webView->setPage(page);
    8686    page->webView = webView;
    87     connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
    88 
    8987    scene.addItem(webView);
    9088
     
    9290    view.resize(600, 480);
    9391    webView->resize(view.geometry().size());
     92
    9493    QCoreApplication::processEvents();
    9594    view.show();
     95
     96    // Resizing the page will resize and layout the empty "about:blank"
     97    // page, so we first connect the signal afterward.
     98    connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
    9699
    97100    page->mainFrame()->setHtml(QString("data:text/html,"
     
    102105
    103106    QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
     107    delete page;
    104108}
    105109
Note: See TracChangeset for help on using the changeset viewer.