Changeset 78490 in webkit


Ignore:
Timestamp:
Feb 14, 2011 10:52:09 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-14 Alexis Menard <alexis.menard@nokia.com>

Reviewed by Andreas Kling.

[Qt] Crash on application exit after constructing and destroying a QWebView twice
https://bugs.webkit.org/show_bug.cgi?id=54000

Check the value is valid before use it.

  • platform/qt/SharedTimerQt.cpp: (WebCore::SharedTimerQt::~SharedTimerQt):

2011-02-14 Alexis Menard <alexis.menard@nokia.com>

Reviewed by Andreas Kling.

[Qt] Crash on application exit after constructing and destroying a QWebView twice
https://bugs.webkit.org/show_bug.cgi?id=54000

Test case to cover the crash.

  • tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::deleteQWebViewTwice):
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r78486 r78490  
     12011-02-14  Alexis Menard  <alexis.menard@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Crash on application exit after constructing and destroying a QWebView twice
     6        https://bugs.webkit.org/show_bug.cgi?id=54000
     7
     8        Check the value is valid before use it.
     9
     10        * platform/qt/SharedTimerQt.cpp:
     11        (WebCore::SharedTimerQt::~SharedTimerQt):
     12
    1132011-02-14  Alexander Pavlov  <apavlov@chromium.org>
    214
  • trunk/Source/WebCore/platform/qt/SharedTimerQt.cpp

    r60736 r78490  
    6969SharedTimerQt::~SharedTimerQt()
    7070{
    71     if (m_timer.isActive())
    72         (m_timerFunction)();
     71    if (m_timer.isActive()) {
     72        if (m_timerFunction) {
     73            (m_timerFunction)();
     74            m_timerFunction = 0;
     75        }
     76    }
    7377}
    7478
  • trunk/Source/WebKit/qt/ChangeLog

    r78352 r78490  
     12011-02-14  Alexis Menard  <alexis.menard@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Crash on application exit after constructing and destroying a QWebView twice
     6        https://bugs.webkit.org/show_bug.cgi?id=54000
     7
     8        Test case to cover the crash.
     9
     10        * tests/qwebpage/tst_qwebpage.cpp:
     11        (tst_QWebPage::deleteQWebViewTwice):
     12
    1132011-02-11  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
    214
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r78135 r78490  
    2727#include <QLineEdit>
    2828#include <QLocale>
     29#include <QMainWindow>
    2930#include <QMenu>
    3031#include <QPushButton>
     
    137138    void navigatorCookieEnabled();
    138139    void navigatorCookieEnabledForNetworkAccessManagerOnDifferentThread();
     140    void deleteQWebViewTwice();
    139141
    140142#ifdef Q_OS_MAC
     
    28162818    QVERIFY(index != -1);
    28172819}
     2820
     2821void tst_QWebPage::deleteQWebViewTwice()
     2822{
     2823    for (int i = 0; i < 2; ++i) {
     2824        QMainWindow mainWindow;
     2825        QWebView* webView = new QWebView(&mainWindow);
     2826        mainWindow.setCentralWidget(webView);
     2827        webView->load(QUrl("qrc:///resources/frame_a.html"));
     2828        mainWindow.show();
     2829        connect(webView, SIGNAL(loadFinished(bool)), &mainWindow, SLOT(close()));
     2830        QApplication::instance()->exec();
     2831    }
     2832}
     2833
    28182834QTEST_MAIN(tst_QWebPage)
    28192835#include "tst_qwebpage.moc"
Note: See TracChangeset for help on using the changeset viewer.