From bf506a6670fc21f6f84a8303c540e49f5edb65fb Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Fri, 1 Aug 2014 15:16:10 +0200 Subject: Fix issue in QtUtilities reported by ASAN. Change-Id: I3e7d65efb4b66897abf735eb9f759122fdf50b89 License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. diff --git a/Swift/QtUI/QtUtilities.cpp b/Swift/QtUI/QtUtilities.cpp index 5ae1b13..0fe2bf2 100644 --- a/Swift/QtUI/QtUtilities.cpp +++ b/Swift/QtUI/QtUtilities.cpp @@ -23,7 +23,8 @@ void setX11Resource(QWidget* widget, const QString& c) { #if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) char res_class[] = SWIFT_APPLICATION_NAME; XClassHint hint; - hint.res_name = (QString(SWIFT_APPLICATION_NAME) + "-" + c).toUtf8().data(); + QByteArray resName = (QString(SWIFT_APPLICATION_NAME) + "-" + c).toUtf8(); + hint.res_name = resName.data(); hint.res_class = res_class; XSetClassHint(widget->x11Info().display(), widget->winId(), &hint); #else -- cgit v0.10.2-6-g49f6