Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ class HTTPRequest

std::string GetURI() { return m_strURI; }


// Clear callbacks to prevent accessing destroyed objects during shutdown
void ClearCallbacks()
{
m_completionCallback = nullptr;
m_progressCallback = nullptr;
}

private:
void PlatformStartRequest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ void HTTPManager::Shutdown()

NetworkLog(ELogVerbosity::LOG_RELEASE, "[HTTPManager] Waiting for %d in-flight requests to complete...", (int)m_vecRequestsInFlight.size());

// Clear all callbacks on in-flight requests to prevent accessing destroyed objects
for (HTTPRequest* pRequest : m_vecRequestsInFlight)
{
if (pRequest != nullptr)
{
pRequest->ClearCallbacks();
}
}

// Wait for all in-flight requests to complete
if (m_pCurl != nullptr)
{
Expand Down
Loading