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