From e664fa5e638d7c6eb6ccc7bc5b82ad76b71b0995 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Dec 2025 11:36:52 -0700 Subject: [PATCH] Revert "avoid double-free of MIDI sys ex and patch change canvas items" This reverts commit 0ddc05055523c5a014e6c3c630541be168f27ced. It is not clear what this commit was really trying to do - when canvas items are deleted they are removed from their parent, so just *not* deleting them should not by itself fix an issue. It turns out that not deleting the canvas item means that it remains in the canvas scene graph to deliver events to, at which time it references its now-deleted owner object, leading to a crash. We need to keep an eye open for crashes resembling the double-free that this reverted commit claimed to fix. --- gtk2_ardour/patch_change.cc | 2 +- gtk2_ardour/sys_ex.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/patch_change.cc b/gtk2_ardour/patch_change.cc index 21a6fe1341..91d2853682 100644 --- a/gtk2_ardour/patch_change.cc +++ b/gtk2_ardour/patch_change.cc @@ -75,7 +75,7 @@ PatchChange::PatchChange (MidiView& region, PatchChange::~PatchChange () { - /* _flag is deleted by the canvas container/parent it is placed in */ + delete _flag; } void diff --git a/gtk2_ardour/sys_ex.cc b/gtk2_ardour/sys_ex.cc index c41b1c5f07..470dab0bdd 100644 --- a/gtk2_ardour/sys_ex.cc +++ b/gtk2_ardour/sys_ex.cc @@ -55,7 +55,7 @@ SysEx::SysEx ( SysEx::~SysEx() { - /* _flag is deleted by the canvas container/parent it is placed in */ + delete _flag; } bool