sdrangel
sdrangel copied to clipboard
ChannelAPI::getIndexInDeviceSet() not valid in channelAdded slot
In a MainCore::channelAdded(int deviceSetIndex, ChannelAPI *channel) slot, it appears channel->getIndexInDeviceSet() is not valid.
This seems to come from the ordering of the following code:
void DeviceSet::addChannelInstance(ChannelAPI *channelAPI)
...
mainCore->addChannelInstance(this, channelAPI);
renameChannelInstances();
addChannelInstance emits the channelAdded signal, but the index isn't set until afterwards in renameChannelInstances().