Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] QgsMSLayerCache: remove layer from QgsMapLayerRegistry befor…
…e delete it In QGIS Server, layers can be added to QgsMapLayerRegistry and delete by QgsMSLayerCache. This means that QgsMapLayerRegistry can have reference to deleted pointers.
- Loading branch information
d3eb164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach would be to connect to QgsMapLayer::destroyed when adding a layer to QgsMapLayerRegistry. That would avoid ever ending up in that situation regardless of the context.
Not sure if there's also a drawback to that.
d3eb164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested to remove references on QgsMapLayer::destroyed but it doesn't work and segfault QGIS.