2864 |
} |
} |
2865 |
} |
} |
2866 |
|
|
2867 |
|
bool bGraceWait = true; |
2868 |
|
|
2869 |
// And try to stop server. |
// And try to stop server. |
2870 |
if (m_pServer && m_bForceServerStop) { |
if (m_pServer && m_bForceServerStop) { |
2871 |
appendMessages(tr("Server is stopping...")); |
appendMessages(tr("Server is stopping...")); |
2876 |
#else |
#else |
2877 |
// Try softly... |
// Try softly... |
2878 |
m_pServer->terminate(); |
m_pServer->terminate(); |
2879 |
|
bool bFinished = m_pServer->waitForFinished(QSAMPLER_TIMER_MSECS * 1000); |
2880 |
|
if (bFinished) bGraceWait = false; |
2881 |
#endif |
#endif |
2882 |
} |
} |
2883 |
} // Do final processing anyway. |
} // Do final processing anyway. |
2884 |
else processServerExit(); |
else processServerExit(); |
2885 |
|
|
2886 |
// Give it some time to terminate gracefully and stabilize... |
// Give it some time to terminate gracefully and stabilize... |
2887 |
QTime t; |
if (bGraceWait) { |
2888 |
t.start(); |
QTime t; |
2889 |
while (t.elapsed() < QSAMPLER_TIMER_MSECS) |
t.start(); |
2890 |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
while (t.elapsed() < QSAMPLER_TIMER_MSECS) |
2891 |
|
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
2892 |
|
} |
2893 |
} |
} |
2894 |
|
|
2895 |
|
|