Fixed a rare crash on exit

This commit is contained in:
SChernykh
2023-01-13 18:25:04 +01:00
parent 14f667de74
commit 2c4c2b8469
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -315,7 +315,7 @@ int CurlContext::on_timer(CURLM* /*multi*/, long timeout_ms)
return 0;
}
if (timeout_ms == 0) {
if ((timeout_ms == 0) && !uv_is_closing(reinterpret_cast<uv_handle_t*>(&m_async))) {
// 0 ms timeout, but we can't just call on_timeout() here - we have to kick the UV loop
const int result = uv_async_send(&m_async);
if (result < 0) {