Pcbnew segfault on exit after using group properties dialog

Description

Steps to reproduce

  1. Open Pcbnew, create two graphic items, group them
  2. Select group, open properties
  3. Close properties dialog
  4. If the group properties dialog has been opened at least once, the DIALOG_GROUP_PROPERTIES destructor segfaults when closing Pcbnew

KiCad Version

Application: KiCad PCB Editor

Version: (5.99.0-10407-g1e8b23402c), release build

Libraries:
	wxWidgets 3.1.4

Platform: Windows 10 (build 19042), 64-bit edition, 64 bit, Little endian, wxMSW

	wxWidgets: 3.1.4 (wchar_t,STL containers)
	Boost: 1.75.0
	OCC: 7.5.0
	Curl: 7.74.0-DEV
	ngspice: 34
	Compiler: Visual C++ 1928 without C++ ABI

Build settings:
	KICAD_SCRIPTING=ON
	KICAD_SCRIPTING_MODULES=ON
	KICAD_SCRIPTING_PYTHON3=ON
	KICAD_SCRIPTING_WXPYTHON=ON
	KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
	KICAD_SCRIPTING_ACTION_MENU=ON
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON
Edited by David Beinder