- Timestamp:
- Nov 9, 2008, 9:45:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qprocess_pm.cpp
r168 r186 193 193 void closeHandles() 194 194 { 195 195 if( pipeStdin != HP_NULL ) { 196 196 DosDisConnectNPipe( pipeStdin ); 197 197 DosClose( pipeStdin ); 198 198 pipeStdin = HP_NULL; 199 199 } 200 200 closePipe( &stdout ); 201 201 closePipe( &stderr ); … … 586 586 if ( proc == pipeKeys.find( key ) ) { 587 587 #if defined(QT_QPROCESS_DEBUG) 588 qDebug( "QProcessMonitor::WM_U_PIPE_CLOSE: proc=%p (%s/%s) d=%p "589 "key=%04hX",590 proc, proc->name(), proc->className(), proc->d, key );588 qDebug( "QProcessMonitor::WM_U_PIPE_CLOSE: proc=%p (%s/%s) d=%p " 589 "key=%04hX", 590 proc, proc->name(), proc->className(), proc->d, key ); 591 591 #endif 592 592 QProcessPrivate *d = proc->d; … … 645 645 // 1. If procesMonitor is NULL, it which means we're somewhere inside 646 646 // the QApplication destruction procedure. 647 // 2. If pipe->key us KEY_NULL, it means GUI thread has already processed647 // 2. If pipe->key is KEY_NULL, it means GUI thread has already processed 648 648 // the WM_U_PIPE_CLOSE message and we're free to access fields w/o a 649 649 // lock. pipe->key is assigned only on the GUI thread, so it's safe … … 686 686 // the client's end of pipe has been closed, so close our end as well 687 687 if ( processMonitor && pipe->key != KEY_NULL ) { 688 // WM_U_PIPE_CLOSE has been posted but not yet processed 689 processMonitor->removeProcess( this, pipe ); 690 } 691 closePipe( pipe ); 688 // WM_U_PIPE_CLOSE has been posted but not yet processed: do 689 // nothing in this case and let it do the close job. This is vital 690 // since if we close the pipe now then it's possible that another 691 // QProcess instance created in the meantime will get a pipe with 692 // the same handle from the system (and therefore with the same key) 693 // so our pending WM_U_PIPE_CLOSE message will attempt to close an 694 // invalid (foreign) pipe 695 } 696 else 697 closePipe( pipe ); 692 698 } 693 699
Note:
See TracChangeset
for help on using the changeset viewer.