Fix memory access violation

The pointer returned by unicode() was deleted right afterwards.

Change-Id: I7cef72386d02c7be42e71134f616926506d37ea6
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
Konstantin Ritt 2013-04-23 12:22:09 +03:00 committed by The Qt Project
parent 01cbd7e4b5
commit 3821047e6c

View File

@ -280,8 +280,7 @@ ushort TableGenerator::keysymToUtf8(quint32 sym)
qDebug() << QString("keysym - 0x%1 : utf8 - %2").arg(QString::number(sym, 16)) qDebug() << QString("keysym - 0x%1 : utf8 - %2").arg(QString::number(sym, 16))
.arg(codec->toUnicode(chars)); .arg(codec->toUnicode(chars));
#endif #endif
const QChar *ch = QString(chars.data()).unicode(); return QString::fromUtf8(chars).at(0).unicode();
return ch->unicode();
} }
quint32 TableGenerator::stringToKeysym(QString keysymName) quint32 TableGenerator::stringToKeysym(QString keysymName)