Handle settings sequencing
Avoids crash when window close ordering places 3d viewer after the common settings are closed
This commit is contained in:
parent
5cd91a952f
commit
c0a9a02591
|
@ -194,12 +194,13 @@ S3D_CACHE::S3D_CACHE()
|
|||
|
||||
S3D_CACHE::~S3D_CACHE()
|
||||
{
|
||||
COMMON_SETTINGS* commonSettings = Pgm().GetCommonSettings();
|
||||
|
||||
FlushCache();
|
||||
|
||||
// We'll delete ".3dc" cache files older than this many days
|
||||
int clearCacheInterval = commonSettings->m_System.clear_3d_cache_interval;
|
||||
int clearCacheInterval = 0;
|
||||
|
||||
if( Pgm().GetCommonSettings() )
|
||||
Pgm().GetCommonSettings()->m_System.clear_3d_cache_interval;
|
||||
|
||||
// An interval of zero means the user doesn't want to ever clear the cache
|
||||
|
||||
|
|
|
@ -559,7 +559,7 @@ void PGM_BASE::SaveCommonSettings()
|
|||
|
||||
COMMON_SETTINGS* PGM_BASE::GetCommonSettings() const
|
||||
{
|
||||
return m_settings_manager ? GetSettingsManager().GetCommonSettings() : nullptr;
|
||||
return m_settings_manager ? m_settings_manager->GetCommonSettings() : nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue