Commit graph

41858 commits

Author SHA1 Message Date
Robin Gareus
d23bcd1685
Fix crash when repeatedly showing group menu
route_group_menu needs to be detached before
TimeAxisView::build_display_menu () deletes and recreates
the parent menu.
2025-12-18 03:43:45 +01:00
Robin Gareus
fbc4bc4437
Fix some more dangling references to RouteGroups
* do not bind a shared_ptr for Edit Group.
* copy by capture, fixes radio group to not retain a reference
2025-12-17 21:34:50 +01:00
Robin Gareus
635916bf7a
Fix crash when group becomes empty but has a subgroup
Session::route_removed_from_route_group() did not delete
the group when it had a subgroup associated with it.
This way it was possible to have an empty track-group that
resulted in various edge-case crashes/assert().
2025-12-17 18:35:45 +01:00
Robin Gareus
370c596322
Backport Mixbus reset-mixer script 2025-12-17 15:15:28 +01:00
Robin Gareus
e9c5c38beb
Fix crash when using group treeview w/o selection 2025-12-17 14:46:07 +01:00
Robin Gareus
13dc1b1058
Don't allow to deactivate master/monitor/surround busses 2025-12-17 14:40:21 +01:00
Paul Davis
a90edc3e1b when the last route is removed from a RouteGroup-with-VCA, drop weak ref to VCA 2025-12-16 22:30:17 -07:00
Paul Davis
927e2d14dd fix copy-n-paste coding that hid route groups in mixer UI 2025-12-16 21:45:34 -07:00
Paul Davis
e1f0a6b731 avoid crash during shutdown, caused by accessing a null session during pointer leave event handling 2025-12-16 20:21:23 -07:00
Paul Davis
8b1b1e2362 GroupTabs: use weak_ptr to manage RouteGroups
GroupTabs only get updated during ::render() (don't ask, don't tell),
and since there is no ::render() call during Session deletion, owning
a shared_ptr<RouteGroup> makes the RouteGroup outlive the session itself.
2025-12-16 20:20:28 -07:00
Robin Gareus
4ad6ffec3d
Fix crash at exit when route-groups are deleted by route drop ref
==1914112==ERROR: AddressSanitizer: heap-use-after-free on address 0x619000483688 at pc 0x7f5b10be03c5 bp 0x7fff55e36670 sp 0x7fff55e36668
READ of size 8 at 0x619000483688 thread T0
    #0 0x7f5b10be03c4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) /usr/include/c++/10/bits/shared_ptr_base.h:911
    #1 0x7f5b1190ecee in std::__shared_ptr<ARDOUR::VCA, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<ARDOUR::VCA, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) /usr/include/c++/10/bits/shared_ptr_base.h:1382
    #2 0x7f5b1190cc3e in std::shared_ptr<ARDOUR::VCA>::shared_ptr(std::weak_ptr<ARDOUR::VCA> const&, std::nothrow_t) /usr/include/c++/10/bits/shared_ptr.h:417
    #3 0x7f5b1190aaae in std::weak_ptr<ARDOUR::VCA>::lock() const /usr/include/c++/10/bits/shared_ptr.h:749
    #4 0x7f5b118fea7e in ARDOUR::RouteGroup::remove(std::shared_ptr<ARDOUR::Route>) ../libs/ardour/route_group.cc:267
    #5 0x7f5b118fde6e in ARDOUR::RouteGroup::remove_when_going_away(std::weak_ptr<ARDOUR::Route>) ../libs/ardour/route_group.cc:223
    #6 0x7f5b11912d3d in void std::__invoke_impl<void, void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>(std::__invoke_memfun_deref, void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&) /usr/include/c++/10/bits/invoke.h:73
    #7 0x7f5b119128c8 in std::__invoke_result<void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>::type std::__invoke<void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>(void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&) /usr/include/c++/10/bits/invoke.h:95
    #8 0x7f5b119125bc in void std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/10/functional:416
    #9 0x7f5b11911fdc in void std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>::operator()<, void>() /usr/include/c++/10/functional:499
    #10 0x7f5b11910e79 in void std::__invoke_impl<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>(std::__invoke_other, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&) /usr/include/c++/10/bits/invoke.h:60
    #11 0x7f5b1190f187 in std::enable_if<is_invocable_r_v<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>, void>::type std::__invoke_r<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>(std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&) /usr/include/c++/10/bits/invoke.h:110
    #12 0x7f5b1190d26a in std::_Function_handler<void (), std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)> >::_M_invoke(std::_Any_data const&) /usr/include/c++/10/bits/std_function.h:291
    #13 0x558120310619 in std::function<void ()>::operator()() const /usr/include/c++/10/bits/std_function.h:622
    #14 0x7f5b10bcb0d6 in PBD::SignalWithCombiner<PBD::OptionalLastValue<void>, void ()>::operator()() ../libs/pbd/pbd/signals.h:508
    #15 0x7f5b10bc779b in PBD::Destructible::drop_references() ../libs/pbd/pbd/destructible.h:33
    #16 0x7f5b1196700f in ARDOUR::Session::destroy() ../libs/ardour/session.cc:822
    #17 0x7f5b11962f93 in ARDOUR::Session::~Session() ../libs/ardour/session.cc:581
    #18 0x7f5b119639a9 in ARDOUR::Session::~Session() ../libs/ardour/session.cc:582
    #19 0x558120305a92 in close_session ../luasession/luasession.cc:366
    #20 0x55812031911c in luabridge::FuncTraits<void (*)(), void (*)()>::call(void (*)(), luabridge::TypeListValues<void>) ../libs/lua/LuaBridge/detail/FuncTraits.h:73
    #21 0x5581203151eb in luabridge::CFunc::Call<void (*)(), void>::f(lua_State*) ../libs/lua/LuaBridge/detail/CFunctions.h:244
    #22 0x55812035701f in luaD_precall ../libs/lua/lua-5.3.5/ldo.c:434
    #23 0x55812038f1bd in luaV_execute ../libs/lua/lua-5.3.5/lvm.c:1136
    #24 0x5581203579a8 in luaD_call ../libs/lua/lua-5.3.5/ldo.c:499
    #25 0x558120357a80 in luaD_callnoyield ../libs/lua/lua-5.3.5/ldo.c:509
    #26 0x558120346f82 in f_call ../libs/lua/lua-5.3.5/lapi.c:943
    #27 0x558120354e59 in luaD_rawrunprotected ../libs/lua/lua-5.3.5/ldo.c:142
    #28 0x55812035924f in luaD_pcall ../libs/lua/lua-5.3.5/ldo.c:729
    #29 0x558120347226 in lua_pcallk ../libs/lua/lua-5.3.5/lapi.c:969
    #30 0x558120393ae9 in LuaState::do_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ../libs/lua/luastate.cc:64
    #31 0x558120306da8 in interactive_interpreter ../luasession/luasession.cc:514
    #32 0x558120307b36 in main ../luasession/luasession.cc:641
    #33 0x7f5b0e40dd79 in __libc_start_main ../csu/libc-start.c:308
    #34 0x558120303179 in _start (/home/rgareus/src/ardour/build/luasession/luasession+0x7a179)

0x619000483688 is located 264 bytes inside of 952-byte region [0x619000483580,0x619000483938)
freed by thread T0 here:
    #0 0x7f5b12cac467 in operator delete(void*, unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:172
    #1 0x7f5b118fc486 in ARDOUR::RouteGroup::~RouteGroup() ../libs/ardour/route_group.cc:168
    #2 0x7f5b11c1c34b in std::_Sp_counted_ptr<ARDOUR::RouteGroup*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/10/bits/shared_ptr_base.h:380
    #3 0x55812031249a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/10/bits/shared_ptr_base.h:158
    #4 0x7f5b10bf9ac4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/10/bits/shared_ptr_base.h:752
    #5 0x7f5b11915cac in std::__shared_ptr<ARDOUR::RouteGroup, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<ARDOUR::RouteGroup, (__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/10/bits/shared_ptr_base.h:1182
    #6 0x7f5b11915cd6 in std::shared_ptr<ARDOUR::RouteGroup>::operator=(std::shared_ptr<ARDOUR::RouteGroup> const&) /usr/include/c++/10/bits/shared_ptr.h:358
    #7 0x7f5b11915b75 in ARDOUR::RouteGroupMember::set_route_group(std::shared_ptr<ARDOUR::RouteGroup>) ../libs/ardour/route_group_member.cc:36
    #8 0x7f5b118fe9fe in ARDOUR::RouteGroup::remove(std::shared_ptr<ARDOUR::Route>) ../libs/ardour/route_group.cc:265
    #9 0x7f5b118fde6e in ARDOUR::RouteGroup::remove_when_going_away(std::weak_ptr<ARDOUR::Route>) ../libs/ardour/route_group.cc:223
    #10 0x7f5b11912d3d in void std::__invoke_impl<void, void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>(std::__invoke_memfun_deref, void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&) /usr/include/c++/10/bits/invoke.h:73
    #11 0x7f5b119128c8 in std::__invoke_result<void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>::type std::__invoke<void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&>(void (ARDOUR::RouteGroup::*&)(std::weak_ptr<ARDOUR::Route>), ARDOUR::RouteGroup*&, std::weak_ptr<ARDOUR::Route>&) /usr/include/c++/10/bits/invoke.h:95
    #12 0x7f5b119125bc in void std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/10/functional:416
    #13 0x7f5b11911fdc in void std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>::operator()<, void>() /usr/include/c++/10/functional:499
    #14 0x7f5b11910e79 in void std::__invoke_impl<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>(std::__invoke_other, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&) /usr/include/c++/10/bits/invoke.h:60
    #15 0x7f5b1190f187 in std::enable_if<is_invocable_r_v<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>, void>::type std::__invoke_r<void, std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&>(std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)>&) /usr/include/c++/10/bits/invoke.h:110
    #16 0x7f5b1190d26a in std::_Function_handler<void (), std::_Bind<void (ARDOUR::RouteGroup::*(ARDOUR::RouteGroup*, std::weak_ptr<ARDOUR::Route>))(std::weak_ptr<ARDOUR::Route>)> >::_M_invoke(std::_Any_data const&) /usr/include/c++/10/bits/std_function.h:291
    #17 0x558120310619 in std::function<void ()>::operator()() const /usr/include/c++/10/bits/std_function.h:622
    #18 0x7f5b10bcb0d6 in PBD::SignalWithCombiner<PBD::OptionalLastValue<void>, void ()>::operator()() ../libs/pbd/pbd/signals.h:508
    #19 0x7f5b10bc779b in PBD::Destructible::drop_references() ../libs/pbd/pbd/destructible.h:33
    #20 0x7f5b1196700f in ARDOUR::Session::destroy() ../libs/ardour/session.cc:822
    #21 0x7f5b11962f93 in ARDOUR::Session::~Session() ../libs/ardour/session.cc:581
    #22 0x7f5b119639a9 in ARDOUR::Session::~Session() ../libs/ardour/session.cc:582
    #23 0x558120305a92 in close_session ../luasession/luasession.cc:366
    #24 0x55812031911c in luabridge::FuncTraits<void (*)(), void (*)()>::call(void (*)(), luabridge::TypeListValues<void>) ../libs/lua/LuaBridge/detail/FuncTraits.h:73
    #25 0x5581203151eb in luabridge::CFunc::Call<void (*)(), void>::f(lua_State*) ../libs/lua/LuaBridge/detail/CFunctions.h:244
    #26 0x55812035701f in luaD_precall ../libs/lua/lua-5.3.5/ldo.c:434
    #27 0x55812038f1bd in luaV_execute ../libs/lua/lua-5.3.5/lvm.c:1136
    #28 0x5581203579a8 in luaD_call ../libs/lua/lua-5.3.5/ldo.c:499
    #29 0x558120357a80 in luaD_callnoyield ../libs/lua/lua-5.3.5/ldo.c:509
    #30 0x558120346f82 in f_call ../libs/lua/lua-5.3.5/lapi.c:943
    #31 0x558120354e59 in luaD_rawrunprotected ../libs/lua/lua-5.3.5/ldo.c:142
    #32 0x55812035924f in luaD_pcall ../libs/lua/lua-5.3.5/ldo.c:729
    #33 0x558120347226 in lua_pcallk ../libs/lua/lua-5.3.5/lapi.c:969
    #34 0x558120393ae9 in LuaState::do_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ../libs/lua/luastate.cc:64
    #35 0x558120306da8 in interactive_interpreter ../luasession/luasession.cc:514
    #36 0x558120307b36 in main ../luasession/luasession.cc:641
    #37 0x7f5b0e40dd79 in __libc_start_main ../csu/libc-start.c:308
2025-12-17 03:14:22 +01:00
Robin Gareus
167359b300
Fix crashes caused by retaining references in 557058f362 2025-12-17 01:45:19 +01:00
Paul Davis
1721681c7d fix display of MIDI regions in cue editors even when they do not start at the source start
This also shows signs of mild improvements in the initial zoom setting for cue editors,
though more work is needed there
2025-12-16 15:30:06 -07:00
Paul Davis
c05877c801 fix crash when editing MIDI notes in a cue editor (there's no playlist) 2025-12-16 15:30:06 -07:00
Robin Gareus
ef9fc93ffc
Fix another static signal that depends on the session
see also 557058f362 and compare to
Mixer_UI::sync_presentation_info_from_treeview
2025-12-16 23:28:06 +01:00
Robin Gareus
557058f362
Fix crash when an early callback changes selection during session load
This can happen e.g. from a VST3 plugin's state restore.
2025-12-16 23:22:43 +01:00
Paul Davis
4273652488 RouteGroupMenu must not bind std::shared_ptr<RouteGroup> to menu items 2025-12-16 13:21:49 -07:00
Paul Davis
37c80a0f27 fix a leftover use of shared_from_this()
This was left from the experimental phase of shared route groups,
when the GUI was still using raw pointers.
2025-12-16 12:08:24 -07:00
Paul Davis
f351c619de group tabs changes to avoid dangling references to RouteGroups
The menu is built and persists between button presses, and so
cannot contain std::shared_ptr<RouteGroup> bindings.
2025-12-16 12:08:24 -07:00
Paul Davis
db6005945f changes to RouteGroup API and mgmt to make explicit group removal work 2025-12-16 12:08:24 -07:00
Krzysztof Gajdemski
321e8c368b Update Polish translation 2025-12-16 19:59:40 +01:00
Robin Gareus
6695748bec
Remove yet another superfluous unistd 2025-12-16 16:27:48 +01:00
Paul Davis
2327070a17 use grid to control distance that arrow keys move automation by
Note that this requires a musical grid type; other types will use a single quarter note.
This should likely be addressed.
2025-12-15 17:16:40 -07:00
Paul Davis
3649987871 fix action descriptions for kbd-driven automation actions 2025-12-15 17:16:40 -07:00
Robin Gareus
64fe619e64
Fix Windows builds (RouteGroup Lua bindings) 2025-12-16 01:02:53 +01:00
Robin Gareus
3f2d5bcbda
Sort strips to import in import dialog 2025-12-16 00:29:23 +01:00
Robin Gareus
983de82ffa
Add option to import invisible mixer strips from templates 2025-12-15 23:50:57 +01:00
Robin Gareus
050d6c07a6
Import strips as new tracks in PI sort order 2025-12-15 23:50:57 +01:00
Paul Davis
199702cda6 AxisView::name() is supposed to be public, so make it so for TimeAxisView 2025-12-15 12:06:11 -07:00
Paul Davis
c0846d876f NO-OP: two random 0 -> nullptr conversions 2025-12-15 12:06:11 -07:00
Robin Gareus
49f359eb8d
Fix RouteGroupList Lua bindings 2025-12-15 20:03:07 +01:00
Paul Davis
e6bb61b86d in pianorolls, allow note-clicks to select in draw mode, just like the editor 2025-12-15 09:59:58 -07:00
Robin Gareus
6eeed82fb3
Update Lua script to use new RouteGroup API 2025-12-14 23:46:59 +01:00
Paul Davis
5abfc59dc1
Use shared_ptr to manage RouteGroups everywhere (GUI edition) 2025-12-14 23:46:57 +01:00
Paul Davis
371bb416a0
Use shared_ptr to manage RouteGroups everywhere (libs edition)
This also drops Session::_all_route_group which was not used,
and makes a little more use of PBD::Unwinder in a few route
group-related contexts.
2025-12-14 23:46:48 +01:00
Robin Gareus
0f9e0afd2b
Fix importing of surround processors
This previously failed in SurroundSend::set_state,
which expects a gain XMLnode to be present.
2025-12-13 23:02:59 +01:00
Robin Gareus
857b25980a
Strip Import: exclude special busses 2025-12-13 23:00:56 +01:00
Robin Gareus
c9b4b94466
Fix source-code visibility comments 2025-12-13 20:14:05 +01:00
EZ4Stephen
c52e8b7dc7
Update zita-convolver's cxxflags for MSVC
Previously:
cl : Command line warning D9002 : ignoring unknown option '-fPIC'
cl : Command line warning D9002 : ignoring unknown option '-O3'
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
cl : Command line warning D9002 : ignoring unknown option '-funroll-loops'
2025-12-13 16:05:09 +01:00
EZ4Stephen
c76f13d6ab
Update fluidsynth cflags 2025-12-13 16:05:09 +01:00
EZ4Stephen
cefbb6db32
Adjust fluidsynth cflags to compile with MSVC
Previously:
cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function'

And after separating that:
cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
2025-12-13 16:05:09 +01:00
EZ4Stephen
98b9839e58
Replace DECLARE_DEFAULT_COMPARISONS 2025-12-13 16:05:05 +01:00
EZ4Stephen
783202d3ad
MSVC waf-build specific fixes
* Dodge ardourext/pthread.h when WAF_BUILD is defined
* add io.h for POSIX style read/close
* define timeval
2025-12-13 16:05:00 +01:00
EZ4Stephen
fb9be868f5
Add MSVC specific compiler flags to wscript 2025-12-13 16:01:03 +01:00
Paul Davis
de542e9d29 do not actually import newly-created SMF sources
TO-DO: ensure the empty sources are somehow removed
2025-12-11 18:20:17 -07:00
Paul Davis
ac83860032 SMF import: better handling of insane files
this really tries to do the right thing regarding meta-events we're interested in,
and channel events we're interested in, no matter how they are distributed across
different channels in the SMF.

it augments/extends the work started in 8a554f659c
2025-12-11 18:20:17 -07:00
Paul Davis
d61a4ba493 make it possible to do certain basic MIDI editing from a context menu in a pianoroll
Quantize, Legatize, Transform and Remove Overlaps (negative legatize) are all handy, and should be accessible
here. There may be other operations to add to this menu in the future
2025-12-11 18:20:17 -07:00
Paul Davis
78a59db334 tweak detection of correct MIDI patch change when removing the canvas item in a MidiView 2025-12-11 18:20:17 -07:00
Paul Davis
aca340b810 an initial fix for a crash occuring when deleting routes that lead to RouteGroup deletion
The RouteGroup containing the deleted routes emits the RouteRemoved signal; Session handles this
and if the RouteGroup is now empty, deletes the RouteGroup *while in the middle of the signal
emission process*. This deletes the Signal (since it was owned by the RouteGroup) which leads
to a crash inside the signal emission code, since that is now running "on" a deleted Signal
object.

This change simply makes that signal static, and so deleting the RouteGroup has no effect
on the Signal itself.

More changes to come related to better (shared_ptr<RouteGroup>) mgmt of RouteGroup lifetimes.
2025-12-11 18:20:17 -07:00
Paul Davis
e664fa5e63 Revert "avoid double-free of MIDI sys ex and patch change canvas items"
This reverts commit 0ddc050555.

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.
2025-12-11 18:20:17 -07:00