 <p>I was calling QDialog::destroy() to close the window instead of QDialog::close(). This caused a null pointer exception when Qt was finishing QDialog::exec() and caused a crash on Windows. Changing the call to close() fixed the problem.</p> <p>Thanks HostileFork for the advice</p>