diff --git a/include/wx/msw/imaglist.h b/include/wx/msw/imaglist.h index fde871c32e..404d8aadd0 100644 --- a/include/wx/msw/imaglist.h +++ b/include/wx/msw/imaglist.h @@ -24,7 +24,7 @@ public: * Public interface */ - wxImageList(); + wxImageList() { Init(); } // Creates an image list. // Specify the width and height of the images in the list, @@ -32,7 +32,7 @@ public: // from icons), and the initial size of the list. wxImageList(int width, int height, bool mask = true, int initialCount = 1) { - m_hImageList = NULL; + Init(); Create(width, height, mask, initialCount); } virtual ~wxImageList(); @@ -198,8 +198,16 @@ public: protected: WXHIMAGELIST m_hImageList; wxSize m_size; + +private: bool m_useMask; + void Init() + { + m_hImageList = NULL; + m_useMask = false; + } + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxImageList); }; diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index de3b4fe564..c52c390065 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -64,12 +64,6 @@ static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask); // wxImageList creation/destruction // ---------------------------------------------------------------------------- -wxImageList::wxImageList() - : m_hImageList(NULL) - , m_useMask(false) -{ -} - // Creates an image list bool wxImageList::Create(int width, int height, bool mask, int initial) {