Evince crashes when selection annotation in sidebar, and removing it with the menu on the view
Summary
Evince crashes when selection annotation in sidebar, and removing it with the menu on the view
Description
This seems to happen because when holding a selection, the tree view does not own references to the annotations (they're all just pointers). Therefore, once the annotation has been removed, the pointer that the tree view holds becomes invalid, and when accessing it, either throws a critical or directly crashes.
I was able to reproduce this both in main
and evince-next
. Reporting this instead of directly fixing it, because the solution is really not trivial. My idea would be to hold an annotation reference in the model. And instead of completely clearing it everytime that an annotation gets added, changed or removed, iterate over the model, find the corresponding annotation that changed, and act accordingly. But not sure if it's the smartest idea, thus why I'm opening the issue.