-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix map layer memory leak with bad layer handling
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.
- Loading branch information
Showing
1 changed file
with
22 additions
and
8 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