diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 57919ff09b..44f2c5fc1a 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -134,6 +134,7 @@ PGM_BASE::PGM_BASE() m_argcUtf8 = 0; m_argvUtf8 = nullptr; m_splash = nullptr; + m_PropertyGridInitialized = false; setLanguageId( wxLANGUAGE_DEFAULT ); diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index 90bef94a26..f800bc037f 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -65,10 +66,11 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame ) wxPGEditor_DatePickerCtrl = nullptr; } - if( !dynamic_cast( wxPGGlobalVars->m_defaultRenderer ) ) + if( !Pgm().m_PropertyGridInitialized ) { delete wxPGGlobalVars->m_defaultRenderer; wxPGGlobalVars->m_defaultRenderer = new PG_CELL_RENDERER(); + Pgm().m_PropertyGridInitialized = true; } m_caption = new wxStaticText( this, wxID_ANY, _( "No objects selected" ) ); diff --git a/include/pgm_base.h b/include/pgm_base.h index 682b064797..c25ccd7519 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -377,6 +377,8 @@ public: bool m_Quitting; + bool m_PropertyGridInitialized; + protected: /// Loads internal settings from COMMON_SETTINGS void loadCommonSettings();