From 7f54617dab046f7b9b89cf2d000f4f04ae798eab Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 23 Sep 2019 06:41:44 -0700 Subject: [PATCH] pcbnew: Clear view prior to terminating On complex boards, the view holds a very large vector of all objects. The dtor will remove each one, searching for the pointer before removing. When removing all items, this process is not needed, so we clear the view when exiting. This also prevents lock-up when closing the full application as KiCad waits for the dtor to finish (non-interactively). This will cause Windows to crash and Linux to offer an option for terminating the non-responsive application. Fixes: lp:1843092 * https://bugs.launchpad.net/kicad/+bug/1843092 --- pcbnew/pcb_base_edit_frame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 1faa9de9c7..003098889e 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -50,6 +50,8 @@ PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME() { wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" ); GFootprintList.WriteCacheToFile( &footprintInfoCache ); + + GetCanvas()->GetView()->Clear(); }