Fix crash when dragging plugins from sidebar

This commit is contained in:
Robin Gareus 2024-12-17 15:48:12 +01:00
parent 72aebf0308
commit cbe838ce26
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 7 additions and 0 deletions

View file

@ -2155,6 +2155,10 @@ not match the configuration of this track.");
bool
ProcessorBox::drag_refuse (DnDVBox<ProcessorEntry>* source, ProcessorEntry*)
{
if (!source) {
/* handle drag from sidebar */
return false;
}
ProcessorBox* other = reinterpret_cast<ProcessorBox*> (source->get_data ("processorbox"));
return (other && other->_route == _route);
}

View file

@ -937,6 +937,9 @@ RegionEditor::RegionFxBox::delete_dragged_plugins (Region::RegionFxList const& f
bool
RegionEditor::RegionFxBox::drag_refuse (Gtkmm2ext::DnDVBox<RegionFxEntry>* source, RegionFxEntry*)
{
if (!source) {
return false;
}
RegionFxBox* other = reinterpret_cast<RegionFxBox*> (source->get_data ("regionfxbox"));
return (other && other->_region == _region);
}