X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..7b70a3257f24daa4d574afd03c82e65631af1f2b:/src/generic/imaglist.cpp diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 9021b540cb..8aac4fa72e 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -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) {