From 47a4099e645b3d711804d8238e0d5ee2192a225d Mon Sep 17 00:00:00 2001 From: Martin Aberg Date: Sat, 23 Jun 2018 12:51:01 +0200 Subject: [PATCH] Disable logging at exit on FreeBSD. This commit fixes a crash on KiCad exit for FreeBSD. Usage of the wxLog functions in destructors on program generates an infinite recursive call loop and segfault on this platform. The workaround is inpired by: https://people.freebsd.org/~wpaul/kicad/kicad_instructions.txt Fixes: lp:1778334 * https://bugs.launchpad.net/kicad/+bug/1778334 --- kicad/kicad.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 91d2e13a34..5df36796e0 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -241,6 +241,11 @@ struct APP_KICAD : public wxApp { program.OnPgmExit(); +#if defined(__FreeBSD__) + /* Avoid wxLog crashing when used in destructors. */ + wxLog::EnableLogging( false ); +#endif + return wxApp::OnExit(); }