Footprint library editor crashes when deleting pad (lp:#1795811)

[Original report](https://bugs.launchpad.net/bugs/1795811) created by **Paul Hansel (paulhansel)**
```
Footprint library editor immediately crashes when deleting a pad. Not clear
why this occurs; is it just that I'm missing "raise.c" ? Possibly a
duplicate of https://bugs.launchpad.net/kicad/+bug/1701092, but that issue
has supposedly been fixed. In this case, the footprint library editor
itself crashes. This doesn't seem like a ratsnest recalculation issue.

BUILD:

Application: kicad
Version: (6.0.0-rc1-dev-641-g3f6819e), release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-137-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

GDB:
...

Thread 1 "kicad" received signal SIGABRT, Aborted.
0x00007ffff501f428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff501f428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff502102a in __GI_abort () at abort.c:89
#2  0x00007ffff50617ea in __libc_message (do_abort=do_abort@entry=2,
    fmt=fmt@entry=0x7ffff517aed8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff506a37a in malloc_printerr (ar_ptr=<optimized out>,
    ptr=<optimized out>, str=0x7ffff517afe8 "double free or corruption
(out)",
    action=3) at malloc.c:5006
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0)
    at malloc.c:3867
#5  0x00007ffff506e53c in __GI___libc_free (mem=<optimized out>)
    at malloc.c:2968
#6  0x00007fffd536931a in
__gnu_cxx::new_allocator<TOOL_EVENT>::deallocate(TOOL_EVENT*, unsigned
long) () from /usr/local/bin/_pcbnew.kiface
#7  0x00007fffd5368f0e in std::allocator_traits<std::allocator<TOOL_EVENT>
>::deallocate(std::allocator<TOOL_EVENT>&, TOOL_EVENT*, unsigned long) ()
   from /usr/local/bin/_pcbnew.kiface
#8  0x00007fffd5368454 in std::_Deque_base<TOOL_EVENT,
std::allocator<TOOL_EVENT> >::_M_deallocate_node(TOOL_EVENT*) () from
/usr/local/bin/_pcbnew.kiface
#9  0x00007fffd536801c in std::_Deque_base<TOOL_EVENT,
std::allocator<TOOL_EVENT> >::_M_destroy_nodes(TOOL_EVENT**, TOOL_EVENT**)
()
   from /usr/local/bin/_pcbnew.kiface
---Type <return> to continue, or q <return> to quit---
#10 0x00007fffd5367585 in std::_Deque_base<TOOL_EVENT,
std::allocator<TOOL_EVENT> >::~_Deque_base() () from
/usr/local/bin/_pcbnew.kiface
#11 0x00007fffd5366eb4 in std::deque<TOOL_EVENT, std::allocator<TOOL_EVENT>
>::~deque() () from /usr/local/bin/_pcbnew.kiface
#12 0x00007fffd5366ae8 in TOOL_EVENT_LIST::~TOOL_EVENT_LIST() ()
   from /usr/local/bin/_pcbnew.kiface
#13 0x00007fffd5befd9a in std::pair<TOOL_EVENT_LIST, std::function<int
(TOOL_EVENT const&)> >::~pair() () from /usr/local/bin/_pcbnew.kiface
#14 0x00007fffd5bfcbe1 in void std::_Destroy<std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> > >(std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*) () from
/usr/local/bin/_pcbnew.kiface
#15 0x00007fffd5bf9e63 in void
std::_Destroy_aux<false>::__destroy<std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*>(std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*, std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*) () from
/usr/local/bin/_pcbnew.kiface
#16 0x00007fffd5bf5d84 in void std::_Destroy<std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*>(std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*, std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*) () from
/usr/local/bin/_pcbnew.kiface
#17 0x00007fffd5bf2c4b in void std::_Destroy<std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*, std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> > >(std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*, std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >*,
std::allocator<std::pair<TOOL_EVENT_LIST, std::function<int (TOOL_EVENT
const&)> > >&) () from /usr/local/bin/_pcbnew.kiface
#18 0x00007fffd5bf01f9 in std::vector<std::pair<TOOL_EVENT_LIST,
std::function<int (TOOL_EVENT const&)> >,
std::allocator<std::pair<TOOL_EVENT_LIST, std::function<int (TOOL_EVENT
const&)> > > >::~vector() ()
   from /usr/local/bin/_pcbnew.kiface
#19 0x00007fffd5bef96e in TOOL_MANAGER::TOOL_STATE::~TOOL_STATE() ()
   from /usr/local/bin/_pcbnew.kiface
#20 0x00007fffd5bf353c in
std::default_delete<TOOL_MANAGER::TOOL_STATE>::operator()(TOOL_MANAGER::TOOL_STATE*)
const () from /usr/local/bin/_pcbnew.kiface
#21 0x00007fffd5bf0807 in std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >::~unique_ptr() ()
   from /usr/local/bin/_pcbnew.kiface
#22 0x00007fffd5bfa4da in void
__gnu_cxx::new_allocator<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >
>::destroy<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >
>(std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >*) () from
/usr/local/bin/_pcbnew.kiface
#23 0x00007fffd5bf661a in void
std::allocator_traits<std::allocator<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> > >
>::destroy<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >
>(std::allocator<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> > >&,
std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >*) ()
   from /usr/local/bin/_pcbnew.kiface
#24 0x00007fffd5bf3712 in
std::deque<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >,
std::allocator<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> > > >::pop_back() () from
/usr/local/bin/_pcbnew.kiface
#25 0x00007fffd5bf0ad8 in
std::stack<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >,
std::deque<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> >,
std::allocator<std::unique_ptr<TOOL_MANAGER::TOOL_STATE,
std::default_delete<TOOL_MANAGER::TOOL_STATE> > > > >::pop() () from
/usr/local/bin/_pcbnew.kiface
#26 0x00007fffd5befbc1 in TOOL_MANAGER::TOOL_STATE::Pop() ()
---Type <return> to continue, or q <return> to quit---
   from /usr/local/bin/_pcbnew.kiface
#27 0x00007fffd5bee352 in
TOOL_MANAGER::finishTool(TOOL_MANAGER::TOOL_STATE*)
    () from /usr/local/bin/_pcbnew.kiface
#28 0x00007fffd5bed7bb in TOOL_MANAGER::dispatchInternal(TOOL_EVENT const&)
()
   from /usr/local/bin/_pcbnew.kiface
#29 0x00007fffd5beecee in TOOL_MANAGER::processEvent(TOOL_EVENT const&) ()
   from /usr/local/bin/_pcbnew.kiface
#30 0x00007fffd5bec339 in TOOL_MANAGER::RunAction(TOOL_ACTION const&, bool,
void*) () from /usr/local/bin/_pcbnew.kiface
#31 0x00007fffd54ebbc9 in void
TOOL_MANAGER::RunAction<std::vector<BOARD_ITEM*,
std::allocator<BOARD_ITEM*> >*>(TOOL_ACTION const&, bool,
std::vector<BOARD_ITEM*, std::allocator<BOARD_ITEM*> >*) () from
/usr/local/bin/_pcbnew.kiface
#32 0x00007fffd58f96ae in BOARD_COMMIT::Push(wxString const&, bool, bool)
()
   from /usr/local/bin/_pcbnew.kiface
#33 0x00007fffd54e3e43 in EDIT_TOOL::Remove(TOOL_EVENT const&) ()
   from /usr/local/bin/_pcbnew.kiface
#34 0x00007fffd54eea52 in int std::_Mem_fn_base<int
(EDIT_TOOL::*)(TOOL_EVENT const&), true>::operator()<TOOL_EVENT const&,
void>(EDIT_TOOL*, TOOL_EVENT const&) const () from
/usr/local/bin/_pcbnew.kiface
#35 0x00007fffd54ee7ae in int std::_Bind<std::_Mem_fn<int
(EDIT_TOOL::*)(TOOL_EVENT const&)> (EDIT_TOOL*,
std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul,
1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) ()
   from /usr/local/bin/_pcbnew.kiface
#36 0x00007fffd54ee1f6 in int std::_Bind<std::_Mem_fn<int
(EDIT_TOOL::*)(TOOL_EVENT const&)> (EDIT_TOOL*,
std::_Placeholder<1>)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT
const&) () from /usr/local/bin/_pcbnew.kiface
#37 0x00007fffd54edb2d in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<std::_Mem_fn<int (EDIT_TOOL::*)(TOOL_EVENT const&)> (EDIT_TOOL*,
std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT
const&) ()
   from /usr/local/bin/_pcbnew.kiface
#38 0x00007fffd5bfc5f5 in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const () from
/usr/local/bin/_pcbnew.kiface
#39 0x00007fffd5bf9435 in COROUTINE<int, TOOL_EVENT
const&>::callerStub(long)
    () from /usr/local/bin/_pcbnew.kiface
#40 0x00007fffd5c5f671 in make_fcontext () from
/usr/local/bin/_pcbnew.kiface
#41 0x0000000000000000 in ?? ()
```

Story points: 6.0