![]() |
#16 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 841
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
The solution, though not perfect:
Code:
if (!m_process.waitForFinished(-1)) { m_process.kill(); m_process.waitForFinished(-1); } 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. |
![]() |
![]() |
![]() |
#17 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Steps to reproduce?
Clicking the X button should now literally be the same thing as clicking the Cancel button. So if it can crash clicking the X, you should be able to also get it to crash using the Cancel button. Last edited by DiapDealer; 11-20-2019 at 12:53 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 841
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
Because TagMechanic crash relatively rarely, try FootnoteManipulator - crash almost every time you press X.
Edit: EpubCheck too. Last edited by BeckyEbook; 11-20-2019 at 01:01 PM. |
![]() |
![]() |
![]() |
#19 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
#20 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 841
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
I tested 20 plugins and I consider the solution quite good. Sigil never crashed, there was not a single error message, even those that usually appeared after pressing "Cancel".
Hmmm ... It's worth doing more tests, but I'm pleasantly surprised. |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
With the latest builds? I would guess this is a Windows only bug. In unix once you kill the process, it is gone and all of its windows go away.
I have no idea how that works in Windows but their must be so e way to kill an entire process! |
![]() |
![]() |
![]() |
#22 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
BeckyEbook, please create a Pull Request with your latest changes so I can see exactly what you are changing and where or post a diff -u here.
Thanks, KevinH |
![]() |
![]() |
![]() |
#23 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Please try removing the first wait call. Then try running terminate() first and if still running, then use kill. I would follow it for a wait of a few seconds max, not unlimited.
Does that help? KevinH Last edited by KevinH; 11-20-2019 at 01:37 PM. |
![]() |
![]() |
![]() |
#24 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#25 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 841
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
Code:
m_process.terminate(); m_process.kill(); |
![]() |
![]() |
![]() |
#26 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I still say that the best way to deal with this is to simply close things how you know you're supposed to!
![]() |
![]() |
![]() |
![]() |
#27 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 841
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
Quote:
With a setting of 3 seconds, python was killed. I think this value is acceptable to everyone. Less seconds = crash. So instead of (-1) you can give (3000). A message (Error Parsing Result XML) appears, but at least it doesn't wait forever. |
|
![]() |
![]() |
![]() |
#28 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
|
![]() |
![]() |
![]() |
#29 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#30 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,769
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi Becky,
Based on your testing, I just pushed the following to master: Code:
void PluginRunner::cancelPlugin() { // qDebug() << "in cancelPlugin()"; if (m_process.state() == QProcess::Running) { m_process.terminate(); } m_process.waitForFinished(2000); if (m_process.state() == QProcess::Running) { m_process.kill(); } m_process.waitForFinished(2000); ui.okButton->setEnabled(true); ui.progressBar->setRange(0,100); ui.progressBar->reset(); ui.textEdit->append(tr("Plugin cancelled")); ui.statusLbl->setText(tr("Status: cancelled")); ui.cancelButton->setEnabled(false); } Combined it waits for 4 seconds to be a bit safer. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Annotations (closed) | GRiker | Plugins | 68 | 06-17-2014 06:11 AM |
[GUI Plugin] Marvin XD (closed) | GRiker | Plugins | 141 | 06-15-2014 05:36 PM |
Plugin thread closed? | BookJunkieLI | Calibre | 3 | 10-05-2013 02:56 PM |
Epub crashes on Sigil for Mac, OK on Sigil for PC | crystamichelle | Sigil | 6 | 08-14-2013 02:52 PM |
Calibre crashes on menu Button selection | entity | Calibre | 6 | 12-15-2012 03:44 AM |