Bug report #21596
Editing a memory layer is corrupted when recreating a memory layer with same name
|Affected QGIS version:||3.7(master)||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29412|
this his how to replicate:
1- create a memory layer ( linestring ) and name it "test"
2- add a new feature ( for example, a short 3 point linestring)
3- SAVE the layer ( mandatory)
5- Remove the layer
6- create a new memory layer ( linestring) with the same name "test"
7- Add a new feature somewhere else ( another 3 point linestring)
8- Click on the node tool and voila! If you try to edit the linestring ... nothing happens. But if you put your mouse over the location where the first linestring was... it will by highlight (red digitizing line)
That's it. It is a problem because i have a plugin that create and recreate a memory layer with the same name.
I hope this is clear enough.
#4 Updated by Alessandro Pasotti almost 2 years ago
- Assignee deleted (
No, sorry: it was a different problem and I could not reproduce the issue described in this ticket.
The only way to reproduce a similar issue is if you delete the features directly from the provder without passing through the QgsVectorLayer edit buffer, which is not recommended btw.
If you remove the layer from the legend it gets deleted and if it gets deleted the snapping locator cache is cleared (well, not really cleared but it won't get used for another layer even if it has the same name).