QQmlImport: Don't try use a dangling pointer.
authorRobin Burchell <robin.burchell@jollamobile.com>
Tue, 3 Dec 2013 20:47:02 +0000 (21:47 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 3 Dec 2013 21:07:43 +0000 (22:07 +0100)
commitcf51cdb8fb002ae3602a4c886e7c67913d77373a
tree18a691329c61edc8f86bae756df88a66b0e4ac9a
parent321fcab5933d37ca9cb5097892621aa4979b45fa
QQmlImport: Don't try use a dangling pointer.

toUtf8 would return a temporary, and constData would hold a pointer inside that
temporary. This isn't even remotely safe. Move the pointer use down to the
initializeEngine call so it is kept around long enough for us to do our stuff.

Task-number: QTBUG-35355
Task-number: QTBUG-35343
Change-Id: Ie816d0d1a37e42607f26d9ad02cf999f3d459cd9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/qqmlimport.cpp