From d03a3903a0e9c50b88c1fed1b7554be60b38940f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 22 Apr 2020 05:02:31 +0200 Subject: [PATCH] Take lock to add/remove custom MIDNAMs update_custom_midnam() is usually called from the GUI or butler thread when a LV2 plugin is instantiated, or the plugin changes its MIDNAM. It must be exclusive with load_midnams_in_thread() and calls from MTAV to ::maybe_use(). --- libs/ardour/midi_patch_manager.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc index 3d5c41ef42..1ceaa17924 100644 --- a/libs/ardour/midi_patch_manager.cc +++ b/libs/ardour/midi_patch_manager.cc @@ -105,6 +105,7 @@ MidiPatchManager::remove_custom_midnam (const std::string& id) bool MidiPatchManager::update_custom_midnam (const std::string& id, const std::string& midnam) { + Glib::Threads::Mutex::Lock lm (_lock); remove_midi_name_document ("custom:" + id, false); return add_custom_midnam (id, midnam); }