mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
More GDI conservation
This commit is contained in:
parent
4660c72c69
commit
dad60f99c0
@ -66,9 +66,18 @@ ACTION_MENU::~ACTION_MENU()
|
||||
Disconnect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), nullptr, this );
|
||||
Disconnect( wxEVT_IDLE, wxIdleEventHandler( ACTION_MENU::OnIdle ), nullptr, this );
|
||||
|
||||
// Explicitly release the GDI resources
|
||||
for( auto subitem : GetMenuItems() )
|
||||
subitem->SetBitmap( wxNullBitmap );
|
||||
|
||||
// Set parent to NULL to prevent submenus from unregistering from a nonexistent object
|
||||
for( ACTION_MENU* menu : m_submenus )
|
||||
{
|
||||
for( auto menuItem : GetMenuItems() )
|
||||
menuItem->SetBitmap( wxNullBitmap );
|
||||
|
||||
menu->SetParent( nullptr );
|
||||
}
|
||||
|
||||
ACTION_MENU* parent = dynamic_cast<ACTION_MENU*>( GetParent() );
|
||||
|
||||
@ -108,6 +117,7 @@ void ACTION_MENU::DisplayTitle( bool aDisplay )
|
||||
// Destroy the menu entry keeping the title..
|
||||
wxMenuItem* item = FindItemByPosition( 0 );
|
||||
wxASSERT( item->GetItemLabelText() == GetTitle() );
|
||||
item->SetBitmap( wxNullBitmap );
|
||||
Destroy( item );
|
||||
|
||||
// ..and separator
|
||||
|
@ -57,6 +57,7 @@ void LAYER_PRESENTATION::DrawColorSwatch( wxBitmap& aLayerbmp, const COLOR4D& aB
|
||||
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
||||
bmpDC.SetPen( *wxBLACK_PEN );
|
||||
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
|
||||
bmpDC.SelectObject( wxNullBitmap );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user