summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <srodal@gmail.com>2014-10-31 18:56:48 +0100
committerSamuel Rødal <srodal@gmail.com>2014-11-03 12:48:43 +0100
commitb4f2205830a4dc199452bc26fb8cab6741a3d4e7 (patch)
treed9cd6450b3550767960d56334463d46a1cbdf0d7
parent6306a74a243dd8a5db85dd9c6dd04d33ecc09569 (diff)
Fixed crash in QGraphicsWebView when clicking on links
The mouse event passed to this function is allocated on the stack, so we can't delete it. Also, it doesn't make sense to allocate a new one which immediately gets leaked. The intent must have been to use the ev parameter as a return parameter - that's what it looks like on the caller side. Change-Id: I023cd7895a278eada4ad4acd233741aff837fed6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index ca0f7d371..57bbd289e 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -475,9 +475,7 @@ void QWebPageAdapter::adjustPointForClicking(QMouseEvent* ev)
if (!foundClickableNode)
return;
- QMouseEvent* ret = new QMouseEvent(ev->type(), QPoint(adjustedPoint), ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
- delete ev;
- ev = ret;
+ *ev = QMouseEvent(ev->type(), QPoint(adjustedPoint), ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
#else
Q_UNUSED(ev);
#endif