Check that SetState() always actually switches states
We shouldn't call SetState() to switch to the state that we're currently already in, normally. Add an assert to verify that this indeed doesn't happen. Also improve the logging statement to show both the old and the new states.
This commit is contained in:
@@ -207,7 +207,9 @@ struct StateEventProcessor
|
||||
|
||||
void wxWebRequestImpl::SetState(wxWebRequest::State state, const wxString & failMsg)
|
||||
{
|
||||
wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: state => %d", this, state);
|
||||
wxASSERT_MSG( state != m_state, "shouldn't switch to the same state" );
|
||||
|
||||
wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: state %d => %d", this, m_state, state);
|
||||
|
||||
m_state = state;
|
||||
|
||||
|
Reference in New Issue
Block a user