Don't rely on dynamic_cast across DLLs

See https://gitlab.com/kicad/code/kicad/-/issues/16998


(cherry picked from commit e9456201a7)
This commit is contained in:
Jon Evans 2024-02-26 22:10:28 -05:00
parent 5b303b268f
commit ffa1d19216
3 changed files with 6 additions and 1 deletions

View File

@ -134,6 +134,7 @@ PGM_BASE::PGM_BASE()
m_argcUtf8 = 0;
m_argvUtf8 = nullptr;
m_splash = nullptr;
m_PropertyGridInitialized = false;
setLanguageId( wxLANGUAGE_DEFAULT );

View File

@ -24,6 +24,7 @@
#include <eda_base_frame.h>
#include <eda_item.h>
#include <import_export.h>
#include <pgm_base.h>
#include <properties/pg_cell_renderer.h>
#include <algorithm>
@ -65,10 +66,11 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
wxPGEditor_DatePickerCtrl = nullptr;
}
if( !dynamic_cast<PG_CELL_RENDERER*>( 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" ) );

View File

@ -377,6 +377,8 @@ public:
bool m_Quitting;
bool m_PropertyGridInitialized;
protected:
/// Loads internal settings from COMMON_SETTINGS
void loadCommonSettings();