mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
fix mysterious web request crash
thank you @dankmeme01
This commit is contained in:
parent
1ce2b32a7f
commit
49738e6029
1 changed files with 6 additions and 2 deletions
|
@ -477,8 +477,12 @@ void SentAsyncWebRequest::Impl::error(std::string const& error, int code) {
|
|||
l.lock();
|
||||
}
|
||||
}
|
||||
std::lock_guard _(RUNNING_REQUESTS_MUTEX);
|
||||
RUNNING_REQUESTS.erase(m_id);
|
||||
// Delay the destruction of SentAsyncWebRequest till the next frame
|
||||
// otherwise we'd have an use-after-free
|
||||
Loader::get()->queueInMainThread([m_id = m_id] {
|
||||
std::lock_guard _(RUNNING_REQUESTS_MUTEX);
|
||||
RUNNING_REQUESTS.erase(m_id);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue