Fix crash in QQuick3DProfiler::registerObject for dynamic objects
When trying to profile the Car Configurator example - either from
Qt Creator, VS Code, or the command line - the example crashes in
QtQuick3DUtils QQuick3DProfiler::registerObject(QObject const*) + 192
In PrincipledExSnowMaterial.qml, TextureInput is instantiated
dynamically via Qt.createComponent and component.createObject().
Without an underlying QML document, compilationUnit in qmlData
is nullptr, causing a SIGSEGV when calling fileName().
Fix this by checking if compilationUnit is null and falling back to
qmlData->outerContext->urlString(). If neither is available, fall
back to an empty string.
Fixes: QTBUG-149874
Pick-to: 6.12
Change-Id: I7bdf767dd9abe279bad78bdb2775ff5f2ef80e63
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>