Merge pull request #1870 from tonytheodore/qtwebkit-crash

qtwebkit: fix crash on startup
This commit is contained in:
Tony Theodore 2017-08-04 12:34:01 +10:00 committed by GitHub
commit e05cde1941
3 changed files with 83 additions and 0 deletions

View File

@ -45,3 +45,50 @@ index 1111111..2222222 100644
#endif
#include <windows.h>
#elif OS(QNX)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Konstantin Tokarev <annulen@yandex.ru>
Date: Fri, 4 Nov 2016 00:44:49 +0300
Subject: [PATCH] Fixed crash (probably miscompilation) with MinGW-w64 5.3.0
Change-Id: Iac1c5fe1879abfaa299ec909e5928912c2354126
taken from:
https://github.com/Martchus/PKGBUILDs/blob/c7b900625449ba7f00539d4e23d2500765bc6f9a/qt5-webkit/mingw-w64/0009-Fixed-crash-probably-miscompilation-with-MinGW-w64-5.patch
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe.cpp b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
index 1111111..2222222 100644
--- a/Source/WebKit/qt/WidgetApi/qwebframe.cpp
+++ b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
@@ -119,16 +119,6 @@ QWebFrameAdapter* QWebFramePrivate::createChildFrame(QWebFrameData* frameData)
return newFrame->d;
}
-QWebFrame *QWebFramePrivate::apiHandle()
-{
- return q;
-}
-
-QObject *QWebFramePrivate::handle()
-{
- return q;
-}
-
void QWebFramePrivate::contentsSizeDidChange(const QSize &size)
{
emit q->contentsSizeChanged(size);
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe_p.h b/Source/WebKit/qt/WidgetApi/qwebframe_p.h
index 1111111..2222222 100644
--- a/Source/WebKit/qt/WidgetApi/qwebframe_p.h
+++ b/Source/WebKit/qt/WidgetApi/qwebframe_p.h
@@ -49,8 +49,8 @@ public:
static QWebFrame* kit(const QWebFrameAdapter*);
// Adapter implementation
- virtual QWebFrame* apiHandle() OVERRIDE;
- virtual QObject* handle() OVERRIDE;
+ virtual QWebFrame* apiHandle() OVERRIDE { return q; }
+ virtual QObject* handle() OVERRIDE { return q; }
virtual void contentsSizeDidChange(const QSize &) OVERRIDE;
virtual int scrollBarPolicy(Qt::Orientation) const OVERRIDE;
virtual void emitUrlChanged() OVERRIDE;

22
src/qtwebkit-test.cpp Normal file
View File

@ -0,0 +1,22 @@
/*
* This file is part of MXE. See LICENSE.md for licensing information.
*
* from: https://github.com/mxe/mxe/issues/1868
*/
#include <QApplication>
#include <QtWebKitWidgets/QWebView>
#include <QtWebKitWidgets/QWebFrame>
int main(int argc, char **argv){
QApplication app(argc, argv);
QWebView *view = new QWebView();
view->load(QUrl("http://google.com/"));
view->show();
app.exec();
}

View File

@ -19,4 +19,18 @@ define $(PKG)_BUILD_SHARED
cd '$(BUILD_DIR)' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake' '$(SOURCE_DIR)'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
# build test manually
# add $(BUILD_TYPE_SUFFIX) for debug builds - see qtbase.mk
$(TARGET)-g++ \
-W -Wall -std=c++11 \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`$(TARGET)-pkg-config Qt5WebKitWidgets --cflags --libs`
# batch file to run test programs
(printf 'set PATH=..\\lib;..\\qt5\\bin;..\\qt5\\lib;%%PATH%%\r\n'; \
printf 'set QT_QPA_PLATFORM_PLUGIN_PATH=..\\qt5\\plugins\r\n'; \
printf 'test-$(PKG).exe\r\n'; \
printf 'cmd\r\n';) \
> '$(PREFIX)/$(TARGET)/bin/test-$(PKG).bat'
endef