forked from qgis/QGIS
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a scoped proj logger to avoid user data lifetime issues
Previously we incorrectly tried to reset the proj logger by calling proj_log_func with a nullptr function in some exit paths. This leads to crashes, as the nullptr arg makes proj_log_func a no-op, and then later proj tries to log using the now destroyed user data string list. Make all this more robust by switching to a scoped QgsScopedProjCollectingLogger class, which automatically correctly restores the default QGIS proj logger on destruction and ensures there's no object lifetime issues for the log function vs the user data object. Fixes qgis#36125, other crashes seen in the wild (cherry picked from commit 244da7a)
- Loading branch information
1 parent
e635dc7
commit bbf2cd0
Showing
4 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters