diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 4e5ffd2d6f..4be014818b 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1460,7 +1460,7 @@ protected: virtual void DoEnable(bool enable) wxOVERRIDE; #ifndef wxPG_ICON_WIDTH - wxBitmap *m_expandbmp, *m_collbmp; + wxBitmap m_expandbmp, m_collbmp; #endif wxCursor m_cursorSizeWE; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index a8c3cad426..e85bbac8b5 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -364,8 +364,6 @@ void wxPropertyGrid::Init1() m_doubleBuffer = NULL; #ifndef wxPG_ICON_WIDTH - m_expandbmp = NULL; - m_collbmp = NULL; m_iconWidth = 11; m_iconHeight = 11; #else @@ -428,13 +426,13 @@ void wxPropertyGrid::Init2() #ifndef wxPG_ICON_WIDTH // create two bitmap nodes for drawing - m_expandbmp = new wxBitmap(expand_xpm); - m_collbmp = new wxBitmap(collapse_xpm); + m_expandbmp = wxBitmap(expand_xpm); + m_collbmp = wxBitmap(collapse_xpm); // calculate average font height for bitmap centering - m_iconWidth = m_expandbmp->GetWidth(); - m_iconHeight = m_expandbmp->GetHeight(); + m_iconWidth = m_expandbmp.GetWidth(); + m_iconHeight = m_expandbmp.GetHeight(); #endif m_curcursor = wxCURSOR_ARROW; @@ -566,11 +564,6 @@ wxPropertyGrid::~wxPropertyGrid() if ( m_iFlags & wxPG_FL_CREATEDSTATE ) delete m_pState; -#ifndef wxPG_ICON_WIDTH - delete m_expandbmp; - delete m_collbmp; -#endif - // Delete common value records for ( i=0; iIsExpanded() ) @@ -1991,7 +1984,7 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect, #elif wxPG_ICON_WIDTH // #else - dc.DrawBitmap( *bmp, r.x, r.y, true ); + dc.DrawBitmap( bmp, r.x, r.y, true ); #endif }