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>
commit2dc0f1a6ac5c4f32db02e448a848d237b4800216
parent27a7248b7f8d3551e0ed0b1f3f35b495a0b9933a
authorİsa Tunahan Öztürk <zenria32@gmail.com>
committerİsa Tunahan Öztürk <zenria32@gmail.com>
commit timeTue, 22 Sep 2026 11:53:08 +0000