diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-07-07 12:36:33 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-07-11 20:01:17 +0000 |
commit | 7c279d779b32eb61987fc7d4f1143a1eaa1a1bde (patch) | |
tree | 8041160837043fb38abef724bab29329ec0dacf7 /src/plugins/platforms/windows/qwindowstabletsupport.cpp | |
parent | f8dc769655959b290d70a2e66e2c3a625aa813cd (diff) |
QWindowsTabletSupport: fix new[]/delete mismatch
QScopedPointer deletes with delete, but a pointer returned from
new[] needs to be deleted with delete[].
Fix by using QVarLengthArray instead of QScopedPointer(new TCHAR[]).
Change-Id: I2f1f252379a9ac1ee919901b5efcec9cec31261e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstabletsupport.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstabletsupport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 222551a86f..87f3eff409 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -47,7 +47,7 @@ #include <QtGui/QGuiApplication> #include <QtGui/QWindow> #include <QtCore/QDebug> -#include <QtCore/QScopedArrayPointer> +#include <QtCore/QVarLengthArray> #include <QtCore/QtMath> #include <private/qguiapplication_p.h> @@ -227,7 +227,7 @@ QString QWindowsTabletSupport::description() const const unsigned size = m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_WINTABID, 0); if (!size) return QString(); - QScopedPointer<TCHAR> winTabId(new TCHAR[size + 1]); + QVarLengthArray<TCHAR> winTabId(size + 1); m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_WINTABID, winTabId.data()); WORD implementationVersion = 0; m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_IMPLVERSION, &implementationVersion); |