Simplify and make more robust wxWebSessionWinHTTP initialization
Rename Init() to Open() as we need this method to return bool to indicate its success in order to avoid using non-initialized handle later. Init() is also reserved, by convention, for the common part of all class ctors in wx code. Remove m_initialized entirely, it doesn't seem to be obviously better to cache the failure to create a session than to retry doing it every time (in fact, it would seem to be worse) and not having it is simpler. This commit is best viewed ignoring white space.
This commit is contained in:
@@ -138,10 +138,9 @@ public:
|
||||
HINTERNET GetHandle() const { return m_handle; }
|
||||
|
||||
private:
|
||||
bool m_initialized;
|
||||
HINTERNET m_handle;
|
||||
|
||||
void Init();
|
||||
bool Open();
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxWebSessionWinHTTP);
|
||||
};
|
||||
|
Reference in New Issue
Block a user