From a7fcdad16d0308f811ef8c71a7c6a53273f4a137 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Fri, 17 Feb 2017 10:39:26 +0100 Subject: X11: Finalize audiodrivers on exit The audiodrivers loaded by OS_X11 are not destroyed before the audioserver is. This causes a segfault on exit. The code is taken from os_windows.cpp which did have the cleanup code. --- platform/x11/os_x11.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e792d0465e..63f56b9c97 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -464,7 +464,6 @@ void OS_X11::finalize() { memdelete(main_loop); main_loop=NULL; - /* if (debugger_connection_console) { memdelete(debugger_connection_console); @@ -512,6 +511,10 @@ void OS_X11::finalize() { args.clear(); + + for (int i = 0; i < get_audio_driver_count(); i++) { + AudioDriverManager::get_driver(i)->finish(); + } } -- cgit v1.2.3