sdrangel icon indicating copy to clipboard operation
sdrangel copied to clipboard

ChannelAPI::getIndexInDeviceSet() not valid in channelAdded slot

Open srcejon opened this issue 4 months ago • 3 comments

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().

srcejon avatar Apr 08 '24 14:04 srcejon