From ad94cb2b4f4bee1dce6fa6bfce3a04b117b83141 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 May 2011 23:31:15 +0000 Subject: [PATCH] Fix assert when creating wxBitmapButton without a valid bitmap in wxMSW. wxBitmapButton can be created without a valid bitmap if SetBitmapLabel() is called later, so don't call SetBitmapLabel() from the constructor if no bitmap was provided. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/bmpbuttn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index 8cf3fc95ac..4cbbbbb978 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -80,7 +80,8 @@ bool wxBitmapButton::Create(wxWindow *parent, validator, name) ) return false; - SetBitmapLabel(bitmap); + if ( bitmap.IsOk() ) + SetBitmapLabel(bitmap); if ( !size.IsFullySpecified() ) { -- 2.45.2