Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qgs3daxis: Correctly delete axis or cube in the destructor #57927

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

ptitjano
Copy link
Contributor

Description

In the desctrutor, mAxisRoot or mCubeRoot may have already been freed by Qt. In that case, a isEnabled() call will create a segmentation fault. By checking the axis mode, this allows to properly know which objects needs to be deleted.

Fixes commit b578f1e

@nyalldawson I was a bit optimistic with my memory leak fix. It can cause a segmentation fault un some cases. This is a proper fix.

In the desctrutor, `mAxisRoot` or `mCubeRoot` may have already been
freed by Qt. In that case, a `isEnabled()` call will create a
segmentation fault. By checking the axis mode, this allows to properly
know which objects needs to be deleted.

Fixes commit b578f1e
@github-actions github-actions bot added this to the 3.40.0 milestone Jun 28, 2024
@ptitjano ptitjano self-assigned this Jun 28, 2024
@ptitjano ptitjano added 3D Relates to QGIS' 3D engine or rendering Crash/Data Corruption labels Jun 28, 2024
Copy link

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit a5b5601)

@nyalldawson nyalldawson merged commit f6cef42 into qgis:master Jun 28, 2024
40 checks passed
@ptitjano ptitjano deleted the fix-memory-leak branch July 16, 2024 14:53
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 backport queued_ltr_backports Queued Backports Crash/Data Corruption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants