Crash closing document while in middle of 3D box creation

Split out from more generic issue #2365 (closed) (which was fixed by https://yet (need to create a VM)gitlab.com/inkscape/inkscape/-/merge_requests/3117). Might be related to #2002 (closed)

Steps to reproduce:

  • open Inkscape
  • switch to the 3D box tool
  • drag to draw a 3D box
  • without releasing the mouse click, Ctrl+W to close the document

What happened?

What should have happened?

  • no crash

Inkscape Version and Operating System:

  • Inkscape 1.2-dev (12564cb3, 2021-04-22) Linux Mint 20
  • Inkscape 0.92.5 (0ad1ac96, 2020-08-06) Linux Mint 20
  • Inkscape 1.2-dev (955154f5, 2021-04-25) Linux Mint 20