Crash when changing preview monitor after disconnecting monitor

What is your operating system?
Windows 10

What is your Shotcut version (see Help > About Shotcut)? Is it 32-bit?
21.05.18 64-bit

Can you repeat the problem? If so, what are the steps?
(Please be specific and use the names as seen in Shotcut, preferably English. Include a screenshot or screen recording if you can. Also, you can attach logs from either View > Application Log or right-click a job and choose View Log.)

  1. Have Shotcut running with a preview on a secondary display
  2. Disconnect the display (for me this was unplugging the USB-C dock that it was connected through)
  3. Change the secondary display preview to None
  4. Shotcut freezes and crashes

Have you tried doing #3 before #2?

EDIT: I’m now on a USB-C Dock. If I set W10 to “Extend” the monitor", I then put a SC window (keyframes in this case) on the secondary monitor, I then select “PC Screen Only” within W10, the secondary screen shuts off and the keyframes window is then moved automatically as top window (focus 0) on the first monitor, SC does not crash with this test.

I have also done the same with the entire SC application on a secondary, same procedure as above, no crash.

See related bug

In short, it’s complicated, and I have been unable to fix it.