Prevent another GAL crash on init due to psuedo-race
Fixes Sentry KICAD-98
(cherry picked from commit 9647a22e50
)
This commit is contained in:
parent
f56fcb0a14
commit
7a2a51ad44
|
@ -58,7 +58,13 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
||||||
const wxPoint& aPosition, const wxSize& aSize,
|
const wxPoint& aPosition, const wxSize& aSize,
|
||||||
KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
|
KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
|
||||||
wxScrolledCanvas( aParentWindow, aWindowId, aPosition, aSize ),
|
wxScrolledCanvas( aParentWindow, aWindowId, aPosition, aSize ),
|
||||||
|
m_MouseCapturedLost( false ),
|
||||||
|
m_parent( aParentWindow ),
|
||||||
m_edaFrame( nullptr ),
|
m_edaFrame( nullptr ),
|
||||||
|
m_lastRefresh( 0 ),
|
||||||
|
m_pendingRefresh( false ),
|
||||||
|
m_drawing( false ),
|
||||||
|
m_drawingEnabled( false ),
|
||||||
m_gal( nullptr ),
|
m_gal( nullptr ),
|
||||||
m_view( nullptr ),
|
m_view( nullptr ),
|
||||||
m_painter( nullptr ),
|
m_painter( nullptr ),
|
||||||
|
@ -70,11 +76,10 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
||||||
m_stealsFocus( true ),
|
m_stealsFocus( true ),
|
||||||
m_statusPopup( nullptr )
|
m_statusPopup( nullptr )
|
||||||
{
|
{
|
||||||
m_parent = aParentWindow;
|
|
||||||
m_MouseCapturedLost = false;
|
|
||||||
|
|
||||||
m_PaintEventCounter = std::make_unique<PROF_COUNTER>( "Draw panel paint events" );
|
m_PaintEventCounter = std::make_unique<PROF_COUNTER>( "Draw panel paint events" );
|
||||||
|
|
||||||
|
m_minRefreshPeriod = 13; // 77 FPS (minus render time) by default
|
||||||
|
|
||||||
SetLayoutDirection( wxLayout_LeftToRight );
|
SetLayoutDirection( wxLayout_LeftToRight );
|
||||||
|
|
||||||
m_edaFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_parent );
|
m_edaFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_parent );
|
||||||
|
@ -146,12 +151,6 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
||||||
Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::OnEvent ), nullptr,
|
Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::OnEvent ), nullptr,
|
||||||
m_eventDispatcher );
|
m_eventDispatcher );
|
||||||
|
|
||||||
m_pendingRefresh = false;
|
|
||||||
m_drawing = false;
|
|
||||||
m_drawingEnabled = false;
|
|
||||||
|
|
||||||
m_minRefreshPeriod = 13; // 77 FPS (minus render time) by default
|
|
||||||
|
|
||||||
// Set up timer that prevents too frequent redraw commands
|
// Set up timer that prevents too frequent redraw commands
|
||||||
m_refreshTimer.SetOwner( this );
|
m_refreshTimer.SetOwner( this );
|
||||||
Connect( m_refreshTimer.GetId(), wxEVT_TIMER,
|
Connect( m_refreshTimer.GetId(), wxEVT_TIMER,
|
||||||
|
|
Loading…
Reference in New Issue