mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +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_COMMAND_MENU_SELECTED, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), nullptr, this );
|
||||||
Disconnect( wxEVT_IDLE, wxIdleEventHandler( ACTION_MENU::OnIdle ), 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
|
// Set parent to NULL to prevent submenus from unregistering from a nonexistent object
|
||||||
for( ACTION_MENU* menu : m_submenus )
|
for( ACTION_MENU* menu : m_submenus )
|
||||||
|
{
|
||||||
|
for( auto menuItem : GetMenuItems() )
|
||||||
|
menuItem->SetBitmap( wxNullBitmap );
|
||||||
|
|
||||||
menu->SetParent( nullptr );
|
menu->SetParent( nullptr );
|
||||||
|
}
|
||||||
|
|
||||||
ACTION_MENU* parent = dynamic_cast<ACTION_MENU*>( GetParent() );
|
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..
|
// Destroy the menu entry keeping the title..
|
||||||
wxMenuItem* item = FindItemByPosition( 0 );
|
wxMenuItem* item = FindItemByPosition( 0 );
|
||||||
wxASSERT( item->GetItemLabelText() == GetTitle() );
|
wxASSERT( item->GetItemLabelText() == GetTitle() );
|
||||||
|
item->SetBitmap( wxNullBitmap );
|
||||||
Destroy( item );
|
Destroy( item );
|
||||||
|
|
||||||
// ..and separator
|
// ..and separator
|
||||||
|
@ -57,6 +57,7 @@ void LAYER_PRESENTATION::DrawColorSwatch( wxBitmap& aLayerbmp, const COLOR4D& aB
|
|||||||
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
|
||||||
bmpDC.SetPen( *wxBLACK_PEN );
|
bmpDC.SetPen( *wxBLACK_PEN );
|
||||||
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
|
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
|
||||||
|
bmpDC.SelectObject( wxNullBitmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user