Skip to content

qgisapp: Fix crash when opening a 3D view with an active elevation profile#66434

Open
ptitjano wants to merge 2 commits into
qgis:masterfrom
ptitjano:3d-view-elevation-profile-crash
Open

qgisapp: Fix crash when opening a 3D view with an active elevation profile#66434
ptitjano wants to merge 2 commits into
qgis:masterfrom
ptitjano:3d-view-elevation-profile-crash

Conversation

@ptitjano

Copy link
Copy Markdown
Collaborator

Description

From the main commit message

When a 3D map view is created, the profile curves are drawn in it, if
the "show profile in 3D views" option is activated. This is achieved
by calling `profileWidget->updateCurveIn3D()` in
`QgisApp::createNew3DMapCanvasDock()`. However, the 3D canvas map
settings have not been initialized it and this results in a crash.

This is fixed by moving the `profileWidget->updateCurveIn3D()` calls
after the canvas widget map settings initialization.

AI tool usage

No AI Tool used

ptitjano added 2 commits June 10, 2026 22:13
The `sizeChanged` lambda captures `this`, so it reads mMarkerMaterial at
emission time. But it can become null if the material has been deleted in
the meantime. This is fixed by capturing the material by value
instead.
…ofile

When a 3D map view is created, the profile curves are drawn in it, if
the "show profile in 3D views" option is activated. This is achieved
by calling `profileWidget->updateCurveIn3D()` in
`QgisApp::createNew3DMapCanvasDock()`. However, the 3D canvas map
settings have not been initialized it and this results in a crash.

This is fixed by moving the `profileWidget->updateCurveIn3D()` calls
after the canvas widget map settings initialization.
@ptitjano ptitjano self-assigned this Jun 10, 2026
@ptitjano ptitjano added 3D Relates to QGIS' 3D engine or rendering Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Jun 10, 2026
@github-actions github-actions Bot added this to the 4.2.0 milestone Jun 10, 2026
@ptitjano ptitjano closed this Jun 11, 2026
@ptitjano ptitjano reopened this Jun 11, 2026
@rouault

rouault commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@ptitjano master only, or 3.44 material ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3D Relates to QGIS' 3D engine or rendering Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants