diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-11-25 13:28:12 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-25 14:41:26 +0100 |
commit | 32ce1172ba456be48163f76a5fbae82020b32a56 (patch) | |
tree | 5a3409057f3efd1400a2468bab8cf0537e71178f | |
parent | 09404c072fec2e195d8114dc4d95ce3683c341cf (diff) |
Fixed memory leak in windowing system event handling
processWindowSystemEvent does not delete the event, so
allocate it on the stack instead.
Change-Id: Iffda940ffc86ef1fabfbf101e08956fa07c49689
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 41a21c67a9..4a704d8051 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -95,8 +95,8 @@ void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &new void QWindowSystemInterface::handleSynchronousGeometryChange(QWindow *tlw, const QRect &newRect) { - QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect); - QGuiApplicationPrivate::processWindowSystemEvent(e); // send event immediately. + QWindowSystemInterfacePrivate::GeometryChangeEvent e(tlw,newRect); + QGuiApplicationPrivate::processWindowSystemEvent(&e); // send event immediately. } void QWindowSystemInterface::handleCloseEvent(QWindow *tlw) @@ -284,8 +284,8 @@ void QWindowSystemInterface::handleUnmapEvent(QWindow *tlw) void QWindowSystemInterface::handleSynchronousExposeEvent(QWindow *tlw, const QRegion ®ion) { - QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, region); - QGuiApplicationPrivate::processWindowSystemEvent(e); // send event immediately. + QWindowSystemInterfacePrivate::ExposeEvent e(tlw, region); + QGuiApplicationPrivate::processWindowSystemEvent(&e); // send event immediately. } bool QWindowSystemInterface::sendWindowSystemEvents(QAbstractEventDispatcher *eventDispatcher, QEventLoop::ProcessEventsFlags flags) |