You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long story: if the store contains a layer with the same ID
it silently fails to add it to the store.
This is the cause of leak in case client code calls
store->addLayers() within the (iterative) process of fixing
bad layers by patching the XML and re-reading it.
The proposed solution is to check in QgsProject::addLayer()
- which creates the layer object - if the newly created layer
was already in the store and delete it at the end of the
layer reading process if it was.
Deleting the layer from within the store->addLayers is
extremely dangerous, because the caller could keep a reference
to the layer and use it.
0 commit comments