Remove RackType when deleting Track

I’d like to know if there’s a proper way to remove a RackType when deleting a Track containing a RackInstance of this one, (actually the only instance of this one)?
For now, I have something like this :

for (auto p : track->pluginList)
    if (auto ri = dynamic_cast<te::RackInstance*> (p))
        edit.getRackList().removeRackType (ri->type);

Is there a more elegant way?

No, that’s the correct way.
We have an option asking if users want to delete RackType when deleting tracks but the logic is basically the same.

1 Like