fix problem when launching adblock and it has errors
This commit is contained in:
		
							parent
							
								
									109842a8b6
								
							
						
					
					
						commit
						fb7f91696c
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -20,6 +20,7 @@ | |||
| #include <QJsonObject> | ||||
| #include <QMessageBox> | ||||
| #include <QProcess> | ||||
| #include <QThread> | ||||
| #include <QTimer> | ||||
| #include <QUrlQuery> | ||||
| #include <QWebEngineProfile> | ||||
|  | @ -316,9 +317,11 @@ QProcess* AdBlockManager::restartServer(int port) { | |||
| 
 | ||||
|   proc->setProcessEnvironment(pe); | ||||
|   proc->setProcessChannelMode(QProcess::ProcessChannelMode::ForwardedErrorChannel); | ||||
|   proc->open(); | ||||
| 
 | ||||
|   if (!proc->open() || | ||||
|       proc->state() == QProcess::ProcessState::NotRunning || | ||||
|   proc->waitForFinished(1000); | ||||
| 
 | ||||
|   if (proc->state() == QProcess::ProcessState::NotRunning || | ||||
|       proc->error() != QProcess::ProcessError::UnknownError) { | ||||
|     auto ers = proc->errorString(); | ||||
|     proc->deleteLater(); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue