Skip to content

Commit

Permalink
try safety on linkableParameterEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jun 15, 2024
1 parent 0a92610 commit 4e237ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Common/ParameterLink/ui/LinkableParameterEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ LinkableParameterEditor::LinkableParameterEditor(Array<ParameterLink*> pLinks, b

LinkableParameterEditor::~LinkableParameterEditor()
{
for (auto& l : links)
if (inspectable.wasObjectDeleted()) return;

for (int i = 0; i < links.size(); i++)
{
if (l == nullptr) continue;
if (!l->isLinkBeingDestroyed) l->removeAsyncParameterLinkListener(this);
if (links[i] == nullptr || inspectables[i] == nullptr || inspectables[i].wasObjectDeleted()) continue;
if (!links[i]->isLinkBeingDestroyed) links[i]->removeAsyncParameterLinkListener(this);
}
}

Expand Down

0 comments on commit 4e237ae

Please sign in to comment.