From f668b2a4c59d75e4a0561b19a741eb95e13b169c Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Thu, 26 Jan 2012 15:28:29 +0000 Subject: [PATCH] [Qt] The Qt MiniBrowser crashes when given multiple URL's https://bugs.webkit.org/show_bug.cgi?id=77009 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Alexander Færøy on 2012-01-26 Reviewed by Simon Hausmann. This patch fixes a crash in BrowserWindow::newWindow() where a BrowserWindow-object is constructed with a 0 pointer as the WindowOptions parameter which leads to a crash. * MiniBrowser/qt/BrowserWindow.cpp: (BrowserWindow::BrowserWindow): (BrowserWindow::newWindow): * MiniBrowser/qt/BrowserWindow.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106003 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 16 ++++++++++++++++ Tools/MiniBrowser/qt/BrowserWindow.cpp | 3 ++- Tools/MiniBrowser/qt/BrowserWindow.h | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 3dfb89d..f58857d0 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,19 @@ +2012-01-26 Alexander Færøy + + [Qt] The Qt MiniBrowser crashes when given multiple URL's + https://bugs.webkit.org/show_bug.cgi?id=77009 + + Reviewed by Simon Hausmann. + + This patch fixes a crash in BrowserWindow::newWindow() where a + BrowserWindow-object is constructed with a 0 pointer as the + WindowOptions parameter which leads to a crash. + + * MiniBrowser/qt/BrowserWindow.cpp: + (BrowserWindow::BrowserWindow): + (BrowserWindow::newWindow): + * MiniBrowser/qt/BrowserWindow.h: + 2012-01-26 Jesus Sanchez-Palencia [Qt] Use ICU if available diff --git a/Tools/MiniBrowser/qt/BrowserWindow.cpp b/Tools/MiniBrowser/qt/BrowserWindow.cpp index 9ccb8a2..de04889 100644 --- a/Tools/MiniBrowser/qt/BrowserWindow.cpp +++ b/Tools/MiniBrowser/qt/BrowserWindow.cpp @@ -37,6 +37,7 @@ #include BrowserWindow::BrowserWindow(WindowOptions* options) + : m_windowOptions(options) { setWindowTitle("MiniBrowser"); setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); @@ -88,7 +89,7 @@ void BrowserWindow::focusAddressBar() BrowserWindow* BrowserWindow::newWindow(const QString& url) { - BrowserWindow* window = new BrowserWindow(); + BrowserWindow* window = new BrowserWindow(m_windowOptions); window->load(url); return window; } diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h index 9593e10..d6ca0a6 100644 --- a/Tools/MiniBrowser/qt/BrowserWindow.h +++ b/Tools/MiniBrowser/qt/BrowserWindow.h @@ -39,7 +39,7 @@ class BrowserWindow : public QQuickView { Q_OBJECT public: - BrowserWindow(WindowOptions* = 0); + BrowserWindow(WindowOptions*); ~BrowserWindow(); void load(const QString& url); void reload(); @@ -56,6 +56,7 @@ protected slots: private: void updateUserAgentList(); + WindowOptions* m_windowOptions; QStringList m_userAgentList; }; -- 2.7.4