* @brief Non-virtual cleanup implementation shared by close() and ~Process(). */
| 91 | * @brief Non-virtual cleanup implementation shared by close() and ~Process(). |
| 92 | */ |
| 93 | void IO::Drivers::Process::doClose() |
| 94 | { |
| 95 | if (m_process) { |
| 96 | m_process->disconnect(); |
| 97 | m_process->terminate(); |
| 98 | if (!m_process->waitForFinished(2000)) |
| 99 | m_process->kill(); |
| 100 | |
| 101 | m_process->deleteLater(); |
| 102 | m_process = nullptr; |
| 103 | } |
| 104 | |
| 105 | m_pipeRunning = false; |
| 106 | if (m_pipeThread.isRunning()) { |
| 107 | m_pipeThread.quit(); |
| 108 | m_pipeThread.wait(); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * @brief Returns true when the process or pipe channel is open. |
nothing calls this directly
no test coverage detected