Remove RackType when deleting Track

Hi,
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);
edit.deleteTrack(track);

Is there a more elegant way?
Thanks

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