Skip to content

Fix a crash after removing a vector layer with active selection of shapes

Steps to reproduce:

  1. set undo limit to 10 steps;
  2. add a vector layer;
  3. add a lot of shapes/text to that;
  4. select some of these shapes
  5. remove the vector layer;
  6. do 10 brush strokes to make sure the vector layer is pushed out of the history;

The problem happened in the following way:

  1. On destruction of the layer, KoSelection::deselect() was called
  2. This deselect() call triggered a start of the QTimer
  3. The timer itself was destroyed in the non-gui thread (in an active state), as was warned by Qt
  4. The timer event was delivered to the destroyed timer, which caused a crash.

BUG:474476

Merge request reports