The solution, though not perfect:
Code:
if (!m_process.waitForFinished(-1)) {
m_process.kill();
m_process.waitForFinished(-1);
}
Sigil does not crash, but requires the user to close all windows opened by python.
Because no message appears – the user may not know what to do at the moment because Sigil stops responding (Not Responded) when such windows are open.
However, since Sigil will not crash – the editions it made before running the plugin will not be lost.
If the problem only occurs in Windows (and in addition not all users), this may be due to processor speed or other factors.
Maybe add a condition only for Windows?
So although this is an extremely rare situation, it still protects your data from loss due to crash.