s_PcbEditFrame freed in some circumstances; can cause plugin crash
Description
Per @dsa-t there is some freed pointer issue that shows up in some circumstances during startup that may relate to crashes seen when loading some Python plugins. May be easiest to reproduce on macOS.
Steps to reproduce
- Open kicad
- Open pcb editor
- Close pcb editor
- Set breakpoint in SCRIPTING_TOOL::callLoadPlugins
- Open footprint editor
- Breakpoint is hit with s_PcbEditFrame being a freed ptr
KiCad Version
Application: KiCad x86_64 on x86_64
Version: 7.0.7, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.13.0
HarfBuzz 7.3.0
FontConfig 2.14.2
libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0
Platform: macOS Ventura Version 13.5 (Build 22G74), 64 bit, Little endian, wxMac
Build Info:
Date: Aug 14 2023 15:55:50
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.82.0
OCC: 7.7.0
Curl: 7.77.0
ngspice: 38
Compiler: Clang 13.0.0 with C++ ABI 1002
Build settings:
KICAD_SPICE=ON