Browse Source

Flush model data upon exit of Footprint Properties dialogs

pull/12/head
Cirilo Bernardo 10 years ago
parent
commit
5776037a70
  1. 7
      3d-viewer/3d_cache/3d_cache.cpp
  2. 4
      3d-viewer/3d_cache/3d_cache.h
  3. 4
      pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
  4. 4
      pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp

7
3d-viewer/3d_cache/3d_cache.cpp

@ -651,7 +651,7 @@ std::list< wxString > const* S3D_CACHE::GetFileFilters( void ) const
}
void S3D_CACHE::FlushCache( void )
void S3D_CACHE::FlushCache( bool closePlugins )
{
std::list< S3D_CACHE_ENTRY* >::iterator sCL = m_CacheList.begin();
std::list< S3D_CACHE_ENTRY* >::iterator eCL = m_CacheList.end();
@ -663,7 +663,10 @@ void S3D_CACHE::FlushCache( void )
}
m_CacheList.clear();
ClosePlugins();
m_CacheMap.clear();
if( closePlugins )
ClosePlugins();
return;
}

4
3d-viewer/3d_cache/3d_cache.h

@ -172,9 +172,9 @@ public:
/**
* Function FlushCache
* frees all data in the cache and closes all plugins
* frees all data in the cache and by default closes all plugins
*/
void FlushCache( void );
void FlushCache( bool closePlugins = true );
/**
* Function ClosePlugins

4
pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp

@ -95,6 +95,10 @@ DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR()
m_Shapes3D_list.clear();
// free the memory used by all models, otherwise models which were
// browsed but not used would consume memory
Prj().Get3DCacheManager()->FlushCache( false );
delete m_ReferenceCopy;
delete m_ValueCopy;
}

4
pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp

@ -94,6 +94,10 @@ DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR()
m_shapes3D_list.clear();
// free the memory used by all models, otherwise models which were
// browsed but not used would consume memory
Prj().Get3DCacheManager()->FlushCache( false );
delete m_referenceCopy;
delete m_valueCopy;
}

Loading…
Cancel
Save