Initialize wxOverlayImpl members in their declarations

Ensure that all member variables are initialized instead of initializing
just some of them in the ctor and leaving others uninitialized, it's
simpler to just do this rather than to check if uninitialized values can
or not be used.
This commit is contained in:
Vadim Zeitlin 2024-02-13 00:43:54 +01:00
parent c4658ec8f2
commit 0217f54894

View file

@ -126,7 +126,7 @@
class wxOverlayImpl: public wxOverlay::Impl
{
public:
wxOverlayImpl();
wxOverlayImpl() = default;
~wxOverlayImpl();
virtual void Reset() override;
@ -138,16 +138,16 @@ public:
void CreateOverlayWindow(wxDC* dc);
WXWindow m_overlayWindow;
WXWindow m_overlayParentWindow;
CGContextRef m_overlayContext;
WXWindow m_overlayWindow = nullptr;
WXWindow m_overlayParentWindow = nullptr;
CGContextRef m_overlayContext = nullptr;
// we store the window in case we would have to issue a Refresh()
wxWindow* m_window;
wxWindow* m_window = nullptr;
int m_x;
int m_y;
int m_width;
int m_height;
int m_x = 0;
int m_y = 0;
int m_width = 0;
int m_height = 0;
} ;
wxOverlay::Impl* wxOverlay::Create()
@ -155,13 +155,6 @@ wxOverlay::Impl* wxOverlay::Create()
return new wxOverlayImpl;
}
wxOverlayImpl::wxOverlayImpl()
{
m_window = nullptr ;
m_overlayContext = nullptr ;
m_overlayWindow = nullptr ;
}
wxOverlayImpl::~wxOverlayImpl()
{
Reset();