diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index fb29fa2f5c..b6d89b5dd1 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -456,7 +456,8 @@ void BitmapComboBoxWidgetsPage::CreateCombo() for ( unsigned int n = 0; n < count; n++ ) { items.Add(m_combobox->GetString(n)); - bitmaps.Add(new wxBitmap(m_combobox->GetItemBitmap(n))); + wxBitmap bmp = m_combobox->GetItemBitmap(n); + bitmaps.Add(new wxBitmap(bmp)); } m_sizerCombo->Detach( m_combobox );