File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,19 +198,22 @@ int main(int argc, char* argv[])
198198 // Reset Connect/Disconnect time.
199199 sd.last_disconnect = sd.last_connect = std::chrono::high_resolution_clock::now ();
200200
201+ bool waitBeforeClosing = false ;
202+
201203 while (!doShutdown) {
202204 if (sd.count_connected == 0 ) {
203205 auto tp = std::chrono::high_resolution_clock::now ();
204206 auto delta = tp - sd.last_disconnect ;
205207 if (std::chrono::duration_cast<std::chrono::milliseconds>(delta).count () > 5000 ) {
206208 doShutdown = true ;
209+ waitBeforeClosing = true ;
207210 }
208211 }
209212 std::this_thread::sleep_for (std::chrono::milliseconds (50 ));
210213 }
211214
212215 // Wait on receive the exit message from the crash-handler
213- {
216+ if (waitBeforeClosing) {
214217 HANDLE hPipe;
215218 TCHAR chBuf[BUFFSIZE];
216219 DWORD cbRead;
You can’t perform that action at this time.
0 commit comments