Make sure projects are cleaned up nicely when frames close
PROJECT objects will be deleted by SETTINGS_MANAGER::UnloadProject so we need to make sure that this is called at an early enough point in the closing process that anything needed by the PROJECT dtor is still around. Also fix an issue where the schematic worksheet was depending on the project existing after the schematic had been reset.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <kiface_i.h>
|
||||
#include <pcb_base_edit_frame.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <pcb_layer_widget.h>
|
||||
@@ -59,6 +60,10 @@ PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME()
|
||||
GFootprintList.WriteCacheToFile( &footprintInfoCache );
|
||||
}
|
||||
|
||||
// Close the project if we are standalone, so it gets cleaned up properly
|
||||
if( Kiface().IsSingle() )
|
||||
GetSettingsManager()->UnloadProject( &Prj() );
|
||||
|
||||
GetCanvas()->GetView()->Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user