Skip to content

Fix crash when clearing annotations after creating a text annotation

Bharadwaj Raju requested to merge work/bharadwaj/fix-text-clear-crash into master

If one creates a text annotation, leaves it selected, and annotations are cleared, the selected action remains the text action, and when the user next tries to make an annotation, the mousePressEvent handler sees that saWrapper is valid and tries to call its commitChange, even though the underlying action has been deleted. This causes a crash.

To prevent this, we call deselectAction in clearAnnotations.

For testing, I recommend trying it with !223, which adds a UI for clearing annotations.

cc @ndavis

Merge request reports