MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / stop

Method stop

MiniZincIDE/process.cpp:421–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void MznProcess::stop()
422{
423 if (p.state() == QProcess::NotRunning) {
424 return;
425 }
426 cancelled = true;
427 p.sendInterrupt();
428 auto* killTimer = new QTimer(this);
429 killTimer->setSingleShot(true);
430 connect(killTimer, &QTimer::timeout, this, [=] () {
431 if (p.state() == QProcess::Running) {
432 terminate();
433 }
434 });
435 connect(this, &MznProcess::finished, killTimer, [=] () {
436 killTimer->stop();
437 delete killTimer;
438 });
439 killTimer->start(1000);
440}
441
442void MznProcess::terminate()
443{

Callers 3

cancelOperationMethod · 0.45
startMethod · 0.45
terminateMethod · 0.45

Calls 2

sendInterruptMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected