X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..e0b97560ed8a93bd5fbf6b46e0081e44e9e1c7b8:/src/generic/imaglist.cpp diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 9021b540cb..ea69fbfaf2 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -29,7 +29,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxGenericImageList, wxObject) -#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) +#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) /* * wxImageList has to be a real class or we have problems with * the run-time information. @@ -45,6 +45,7 @@ wxGenericImageList::wxGenericImageList( int width, int height, bool mask, int in wxGenericImageList::~wxGenericImageList() { + (void)RemoveAll(); } int wxGenericImageList::GetImageCount() const @@ -109,17 +110,15 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); - wxBitmap* newBitmap = NULL; - if (bitmap.IsKindOf(CLASSINFO(wxIcon))) -#if defined(__VISAGECPP__) -//just can't do this in VisualAge now, with all this new Bitmap-Icon stuff -//so construct it from a bitmap object until I can figure this nonsense out. (DW) - newBitmap = new wxBitmap(bitmap) ; -#else - newBitmap = new wxBitmap( (const wxIcon&) bitmap ); -#endif - else - newBitmap = new wxBitmap(bitmap) ; + wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? + #if defined(__VISAGECPP__) + //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff + //so construct it from a bitmap object until I can figure this nonsense out. (DW) + new wxBitmap(bitmap) + #else + new wxBitmap( (const wxIcon&) bitmap ) + #endif + : new wxBitmap(bitmap) ; if (index == (int) m_images.GetCount() - 1) {