Initialize all fields in wxWebRequestEvent default ctor
Default ctor was leaving pointers uninitialized which was dangerous, so merge it with the other ctor to ensure that we always set them to NULL. Also make m_response const as it can't be changed after creating the event.
This commit is contained in:
@@ -262,9 +262,11 @@ private:
|
|||||||
class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent
|
class WXDLLIMPEXP_NET wxWebRequestEvent : public wxEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxWebRequestEvent() {}
|
wxWebRequestEvent(wxEventType type = wxEVT_NULL,
|
||||||
wxWebRequestEvent(wxEventType type, int id, wxWebRequest::State state,
|
int id = wxID_ANY,
|
||||||
wxWebResponse* response = NULL, const wxString& errorDesc = "")
|
wxWebRequest::State state = wxWebRequest::State_Idle,
|
||||||
|
wxWebResponse* response = NULL,
|
||||||
|
const wxString& errorDesc = wxString())
|
||||||
: wxEvent(id, type),
|
: wxEvent(id, type),
|
||||||
m_state(state), m_response(response), m_data(NULL), m_dataSize(0),
|
m_state(state), m_response(response), m_data(NULL), m_dataSize(0),
|
||||||
m_errorDescription(errorDesc)
|
m_errorDescription(errorDesc)
|
||||||
@@ -291,7 +293,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
wxWebRequest::State m_state;
|
wxWebRequest::State m_state;
|
||||||
wxWebResponse* m_response; // non-owning, may be NULL
|
wxWebResponse* const m_response; // non-owning, may be NULL
|
||||||
wxString m_responseFileName;
|
wxString m_responseFileName;
|
||||||
const void* m_data;
|
const void* m_data;
|
||||||
size_t m_dataSize;
|
size_t m_dataSize;
|
||||||
|
Reference in New Issue
Block a user