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>
This commit is contained in:
Marc Mutz 2016-07-07 12:36:33 +02:00
parent f8dc769655
commit 7c279d779b

View File

@ -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);