Slightly simplify code removing temporary file

There is no need to check the state and storage type again when we had
just done it.
This commit is contained in:
Vadim Zeitlin
2021-01-12 03:09:56 +01:00
parent 67ad831a31
commit a1e0b7e292

View File

@@ -290,9 +290,9 @@ void wxWebRequestImpl::ProcessStateEvent(wxWebRequest::State state, const wxStri
m_handler->ProcessEvent(evt);
// Remove temporary file if it still exists
if ( state == wxWebRequest::State_Completed && m_storage == wxWebRequest::Storage_File &&
wxFileExists(responseFileName) )
// Remove temporary file if we're using one and if it still exists: it
// could have been deleted or moved away by the event handler.
if ( !responseFileName.empty() && wxFileExists(responseFileName) )
wxRemoveFile(responseFileName);
}