From 72057395ebdad16556652fe827bb93210f6f1270 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 25 May 2025 00:21:00 +0200 Subject: [PATCH] Fix potential use-after-free (when device in use) An instance must not delete itself.. Here ARDOUR::SystemExec::Terminated signal handler deleted the class that emitted the signal in the same thread. --- libs/backends/alsa/alsa_audiobackend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 27ee52c6de..db51c75502 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -2425,7 +2425,7 @@ AlsaDeviceReservation::release_device () _reservation_connection.drop_connections (); ARDOUR::SystemExec* tmp = _device_reservation; _device_reservation = 0; - delete tmp; + Glib::signal_idle().connect ([tmp] { delete tmp; return false; }, Glib::PRIORITY_HIGH_IDLE); } void