mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
construct QVarLengthArray<T>() with the right size instead of resizing it in QDBusMetaObjectGenerator::write()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f2514df245
commit
52fa383ec2
1 changed files with 2 additions and 2 deletions
|
@ -343,8 +343,8 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
||||||
if (className.isEmpty())
|
if (className.isEmpty())
|
||||||
className = QLatin1String("QDBusInterface");
|
className = QLatin1String("QDBusInterface");
|
||||||
|
|
||||||
QVarLengthArray<int> idata;
|
static const int QDBusMetaObjectPrivateSize = (sizeof(QDBusMetaObjectPrivate) / sizeof(int));
|
||||||
idata.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int));
|
QVarLengthArray<int> idata(QDBusMetaObjectPrivateSize);
|
||||||
|
|
||||||
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
|
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
|
||||||
header->revision = qmetaobjectrevision;
|
header->revision = qmetaobjectrevision;
|
||||||
|
|
Loading…
Add table
Reference in a new issue